When did the concept of flagging start?

Seeing another question at UX.SE related to flagging, I realized that flagging is always associated to a negative connotation. I understand that Flags are Used to Convey Messages (such as Naval Flag Signaling or Beach Warning Flags). However, these messages are either negative, positive or neutral.

The negative connotation probably comes from the red flag but what I'd like to know is: when did it start in computers and why (or how) did it become negative?

Additionally: is there (or was at any point) a flag messaging system with different meanings and connotations?