Are rifles and pistols not guns?
No, in the military, rifles and pistols are never called guns -- they're called rifles, pistols, or (more commonly) weapons.
"Gun" strictly refers to a crew-served weapon like a machine gun or a hozitzer, and new recruits are mocked heavily if they screw up and refer to their personal weapon as a gun.
(You learn this the first day at basic training -- and reporters are constantly giving away their lack of military knowledge by making this very common mistake.)
Yes, they are... but the military thrives on it's silly customs.
"Are rifles and pistols not guns?"
Not if you are a marine. Ships have guns. Marines have rifles and pistols.