This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Add DISABLEWARNING support to C51?

The new BL51 option to disable specific warning messages is very nice! I would also like to have this capability in the C51 compiler (finer-grained control than WARNINGLEVEL). Specifically, there are times when I want to disable warning C280 (unreferenced local variable) when I know that I will not reference a parameter to the subroutine, and then re-enable that warning for subsequent functions in that module. For example:

#pragma DISABLEWARNING(280)
void funct1( char p1, char p2 )
{
// this function does not need p1
do something with p2, ignore p1
}
#pragma ENABLEWARNING(280)
void funct2( char p1, char p2 )
{
//this function SHOULD use both params
// so I want the warning if I mess up
}

0