But do you know what else the US does?
The locations of military and non-military buildings is public information, and even intentionally made obvious to anyone. You can get maps of the bases from their websites. You can even go on google maps and see what most of the buildings are. To avoid exactly this situation. And even beyond all that, in the event of military escalation where their is real threat of the bases being hit, the civilians would be evacuated anyway.
(Legitimate) countries at war aren't trying to massacre civilians. They all agreed to that and all take agreed upon steps to stop it. Like at the most basic level issuing uniforms to soldiers so you can clearly see who is a civilian and who is a fighter.
I can assure you that in a war between the US and China, there would be dramatically fewer civilian deaths, because both countries don't fuck around with "military/civilian ambiguity" as a war tactic. Because you or your enemy end up killing a bunch of innocents.