Do the Death Note rules permit the user to state "death by gunfire" as a cause of death?
The conditions for death will not be realized unless it is physically possible for that human or it is reasonably assumed to be carried out by that human.
If the condition can not be met because it's not possible, just as Light's Experiments found and in How to use LV: Point 2, they would just die from a heart attack
death by gunfire is quite open to interpretation, with Kiichiro Osoreda Light could have had him "die by gunfire" which could have had him killed by Raye Penber after emptying his gun or get hit by a bullet bouncing around after he shoots through Ryuk
this is about as ambiguous as "death by suicide" used by Light to kill Naomi Misora so even if the cause is ambiguous if it's achievable it'll happen, in Naomi's case we see a artistic rendition of her going to a noose however Light had wrote down that her body is never found so i very much doubt she's hanged herself so the artistic rendition is just to show she's marching off to her death
As stated in How to Use I: Point 3 and How to Use III: Point 1 if you write a person's name you have 40 seconds to either write the cause of death or the time of death after their name is write, after that as stated in Point 6 of How to Use I you then have 6 minutes and 40 seconds to details of the death however just saying death by gunfire or dies from gunfire may not be enough unless it's possible or reasonably for the target to be in a situation with a gun present, within the allotted time, in which case we can assume is within 6 minutes and 40 second, it will have a higher success rate in war zones or areas of high gun crime as "gunfire" could be from stray bullets.
in the situation where you specify the time of death first you probably have more success depending on how long the person has left to live, if you write down they die at 6:00 PM and you wrote that at 5:58 PM then wrote "death by gunfire" then in that 2 minutes the person has to be in the situation to die like that.
For the best results, As we see with Light's Execution of the FBI, the greatest rate of success would come from detailing everything before writing the person's name, this way you have all the time you need to detail how anyone could possibly be in a situation where "Death by gunfire" is the result of their death
It doesn't break any rules to write that someone dies of shooting. In the Live Action film, Light writes that Naomi shoots Shiori and then shoots herself.
Ill Ratt from the SPK shoots himself as per instructions in the Death Note.
Here's some of the relevant rules concerning the cause of death:
How To Use I:
3: If the cause of death is written within the next 40 seconds of writing the person's name, it will happen.
4: If the cause of death is not specified, the person will simply die of a heart attack.
5: After writing the cause of death, details of the death should be written in the next 6 minutes and 40 seconds.
How To Use III:
1: If the time of death is written within 40 seconds after writing the cause of death as a heart attack, the time of death can be manipulated, and the time can go into effect within 40 seconds after writing the name.
How To Use X:
1: Suicide is a valid cause of death. Basically, all humans are thought to possess the possibility to commit suicide. It is, therefore, not something unbelievable to think of.
2: Whether the cause of the individual's death is either a suicide or accident. If the death leads to the death of more than the intended, the person will simply die of a heart attack. This is to ensure that other lives are not influenced.
How To Use: XXVI:
1: If you just write, "die of accident" for the cause of death, the victim will die from a natural accident after 6 minutes and 40 seconds from the time of writing it.
2: Even though only one name is written in the Death Note, if it influences and causes other humans that are not written in it to die, the victim's cause of death will be a heart attack.
How To Use: XXVII
2: If you write, die of disease for the cause of death, but only write a specific time of death without the actual name of disease, the human will die from an adequate disease. But the Death Note can only operate within 23 days (in the human calendar). This is called the 23 day rule.
How To Use: LV
2: In the occasion where the cause of death is possible but the situation is not, only the cause of death will take effect for that victim. If both the cause and the situation are impossible, that victim will die of heart attack.