By default, if you have your weapon lowered and press the fire button once, it should raise your weapon without firing it.
However, it's possible to get into a bugged state where fire won't be inhibited while the weapon is lowered, and you'll end up firing while raising your weapon. This only seems to happen in the crouched stance.
As fun as it was shooting full auto off to the side while sprinting in ArmA 1, I don't think this is intended. Issue 0001870 "Launchers fire when clicking to exit gear-stance" is probably related to this as well.