If intentional targeting of civilians in wartime is a war crime, then why bombing Hiroshima and Nagasaki is not a war crime?

by dopenosia

Not only Hiroshima and Nagasaki but also killing defenceless civilians in the Vietnam War? If just because it "shortened the war" It just doesn't add up or, do I miss some points? Please enlighten me.

Gankom