I know this will get downvoted but, I say Throw the building codes out the window. Housing people is more important than regulations.
If it made a difference to your ability to get shelter, which would you rather choose: have shelter or live in a illegal tent under a bridge resting assured with the knowledge that there's a big book of rules in place.