This is not the law here in Sweden, at least.
We don't have precedent in the way that common law countries do, and the judgements in actual cases point in slightly different directions-- in one case a court felt that the failure to fire a warning shot made it not self-defence, in another fighting people trying to get into an apartment with a knife was deemed acceptable.
Generally though, if someone is breaking into your apartment while you're there, possibly trying to get at you, there's no limit, as long as you're actually trying to defend yourself (so no executing someone who you've clearly disabled, etc.).
If people are breaking into your apartment and you fire a warning shot, then proceed to shoot the attackers, no one will complain.