"a house": This tells me only of a house. Whence do I derive (the same for) a straw-bin, a cattle-shed, and a store-house? From "If you build."

In that case I might think (that also included) is the building of a gateway, a portico, or a porch; it is, therefore, written "a house." Just as a "house" is characterized by being subject to occupancy (so, all that are similarly characterized are subsumed in the halachah) — to exclude the aforementioned, which are not thus characterized.

"you shall make a railing for your roof": This tells me only of a roof. Whence do I derive the same (i.e., the need for protective safeguards) for holes, pits, caves, and ditches? From "and you shall not place blood in your house" (i.e., in the domain of your house. If so, why is "roof" mentioned? To exclude a ramp (and the like).