Building codes specify minimum standards for the construction of buildings. The codes themselves are not legally binding. They serve, rather, as "models" for legal jurisdictions to utilize when developing statutes and regulations.
The main purpose of building codes are to protect public health, safety and general welfare as they relate to the construction and occupancy of buildings and structures.
The building code becomes law of a particular jurisdiction when formally enacted by the appropriate governmental or private authority.