Police should assume anyone is armed until the prove to themselves otherwise.
A law that requires notification provides them no real extra protection, but can in some situations endanger the informer.
Sometimes exclaiming you have a gun is not the ideal course of action when dealing with LEO. Sometimes it is an appropriate course of action to inform them.
A general encounter that will soon be over with both of you going on your ways without anyone uncovering the firearm, as in most routine traffic stops, is not the time to suddenly make a LEO mentally focused on you being armed.
Every LEO reacts differently, some are fine with it, with some you may earn brownie points, and with others it can illicit a paranoid mental demeanor or worse.
There is also the chance for mis-communication. For example I certainly wouldn't want one cop to inform his partner you have a gun, and his partner to misinterpret it as a call for help from an armed threat. More than one cop has pulled his weapon or ended a threat after hearing "He's got a gun" from another cop.