supressing a unused variable warning
-
Hi, How would I supress a warning for a certain variable which I know is unused? On other compilers I can use something like #pragma unused (variableName). Thanks Hua-Ying
-
UNUSED(x); UNUSED_ALWAYS(y); UNREFERENCED_PARAMETER(z);
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03 "Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04 Within you lies the power for good - Use it!
-
Hi, How would I supress a warning for a certain variable which I know is unused? On other compilers I can use something like #pragma unused (variableName). Thanks Hua-Ying
Another approach is the following:
void function(type1 parm1,type2 /*parm2*/)
{
//...
}Commenting out the parameter name in the argument list guarentees that the parameter isn't used, since there is no longer a definition for it (the compiler will issue an error message otherwise).
Software Zen:
delete this;