Board index » cppbuilder » Re: bcb6 incorrectly warns 'declared but never used'
Tamas Demjen
![]() CBuilder Developer |
Re: bcb6 incorrectly warns 'declared but never used'2004-01-15 08:01:33 AM cppbuilder77 QuoteThus nTimes is REALLY const. It is undefined to cast away constness to turn the 8080 compiler warning off. No matter how many times you try to read that const value, the compiler won't shut up. Unfortunately the ACE_UNUSED_ARG(a) didn't work. SHUT_UP_ALMOST_ANY_COMPILER(x) neither: const int nTimes = 3; (void) nTimes; // still there's a warning! for (int k=0; k<nTimes; k++){ MessageBox(0,"MESSAGE","TITLE",0); } It's a bug, and you can not silence the compiler in any other way but to turn off the warning itself. Tom |