DISCLAIMER: NOT AN ATTORNEY, LEGAL EXPERT OR SANE PERSON. THE FOLLOWING IS STRICKLLY AN OPONION AND IS NOT TO BE RELIED UPON. CHECK WHITH YOUR STATE FOR THE APPLICABLE GUN LAWS.
Warning shot?

Why on earth would you, at a moment when you are "IN FEAR OF YOUR LIFE FROM AN IMMENENT THREAT!" fire a warning shot? I am no legal expert, but I have never heard of this requirement (see disclaimer). Remember, you are in most states permitted to Use Deadly Force IF AND ONLY IF you are 1. In Fear of your life or in fear that others are gong to be harmed. 2. The threat is immanent. 3. The threat has the ability to cause harm/death.
Let's explore the mechanics of a "Warning Shot";
1.
Exactly where are you going to aim when you fire they warning shot? Planning of a near flyby with the bullet of the attacker? Shoot the floor? Shoot the ceiling? Shoot the wall? Where are your going to shoot?
2, Warning shot goes through how many walls etc. Remember this bullet is not hitting center mass of target, it is heading downrange undamaged and with full potential energy.
3. Shoot at the floor? Ricochet off cement, tile, or a nail head is a possibility. If you are not on the the lowest floor in the building it may strike someone in the floor below (or basement).
4. Shoot into the ceiling? Put a hole in a perfectly good roof and what goes up, will come down. I have seen several people wounded by bullets falling out of the sky. What if you are not on the top floor of the building? You could shoot someone on the floor above you.
No my friend, firing a warning shot not only puts others down range in danger but communicates to the attacker that you are not willing to take a life and shoot them.
Verbal warning of "Halt Or I Will Shoot" - again check with your local state. I am not a fan of telling an armed intruder who is threating my life or that of others that they better shoot or stab or attack now because if they don't I am going to shoot, in a minute....if I get up the nerve. If they don't get the message when you draw a controlled, steady well aimed at center of mass sight picture on them, then...well they are never going to get the message. I will also tell you that if you say, "STOP! Take one more step and I will shoot", the response may just be, "Go ahead and shoot" as then continue towards you. (personal experience). So I don't recommend it.
Personal definition of a warning shot....the first and last shot fired that leaves me to explain to the police how the intruder died.