So some really aggressive German Sheppard, that has already bit a few kids, can charge me in my front yard and I cannot fire a warning directly into the soft earth below my well watered grass.
Fine with me, laws are laws.
IMO animals are a bit different than a person esp. if we're talking about being out in nature and trying to dissuade a bear, a place where it's OK to shoot anyway in many (but not all cases), but if an aggressive dog with a history of attacks is charging you I'd definitely say you shoot to stop the dog, not scare it.
If it's an endangered species and it is just a possible threat maybe breaking some law on discharging a gun is better than dealing with the EPA for the next 10 years in court, but even then it may or may not be legal in a given area.
I certainly understand the desire to diffuse a situation, but here's what it comes down to at the law in many if not most places (but not all): You should only discharge a weapon if you are in imminent danger.
If you are in imminent danger then you don't have time for a warning shot and will be risking your safety to take one. If you are not in danger so imminent that a warning shot is risking your safety, then you are not at enough risk to have discharged the weapon in the first place.
For me it's not even if I agree with it or not. In many places that's the law. Yell you have a gun if you want, carry a polished chrome one he can't miss, etc., but the law says if you pull the trigger it had better be b/c you were in imminent danger of harm, and that position is inherently inconsistent with having the option of a warning shot.
Note however that this is not "the law" but I've been careful to say "the law in many places". "The Law" changes every few miles in this country. If you live on a 1,000 acre ranch you could presumably shoot anywhere anytime you want on that land, you'd be fine legally. I posted what I did b/c a lot of people live in more urban areas where they could be charged with a crime for discharge or cause unintentional harm or damage. It's just good basic policy faced with the broadest possible "should I fire warning shots" question IMO. Just like the law, no one answer can meet all possible cases or circumstances.
I should add that even on that ranch, if you fired at the barn and someone was working in that barn you could be in trouble. that's the inherent danger of it when asked in these broad terms. Firing in the air, firing across the house, etc. is showing poor muzzle discipline, if you don't know what is along that path you could be putting someone or some property at risk.