You are responsible for every round that comes out of your muzzle. A warning shot does nothing to help you stop the threat and will very likely give prosecutors a reason to claim that you were either not in imminent danger or acting in a reckless manner. Once a prosecutor starts asking questions about why you fired a shot at something other than your attacker, your defense attorney has to deal with topics not related directly to your legal defense. Don’t do it. If you need to use your gun to stop a threat, fire it accurately at the threat and repeat that action until the threat stops. Warning shots cause more trouble than they are worth.
Just Don’t Do It
There is really no more to say on the topic. Warning shots cause problems. Avoid problems.