The warning system uses a counter (as Lock / Unlock) so either the code has a mismatch between Ons and Offs or the project level check box setting is not being passed to the compiler to set the initial count.