[Bf-committers] Re: Solution for suppressing "unused parameter"warnings?

Ken Hughes khughes at pacific.edu
Wed May 31 01:43:59 CEST 2006

Joe Eagar wrote:
> Gilbert, Joseph T. wrote:
>> MSVC doesn't generate the same compiler warnings. The projectfiles 
>> still generate a TON of warnings but they're not the same things that 
>> gcc puts out. The unused 'self' variable warning doesn't show up in 
>> the VC compiler. (at least not at it's current warnings lvl). Adding 
>> code like UNUSED(x) would be extremely strange imho since windows 
>> doesn't even generate this warning.
>> The only reliable way on the vc compiler versions is to suppress 
>> warnings is by inserting the #pragma <warning> code into the files 
>> that are throwing warnings. In theory you can insert warning 
>> suppresion into the projectfiles, but this seems to be buggy on some 
>> versions.   
> Mingw gcc will throw all kinds of "Warning: deprecated use of #pragma" 
> warnings if you use pragma.  I think finding and implementing the 
> necessary compiler flags for gcc and msvc (and perhaps the irix compiler 
> if that's still supported) would be the best thing to do.

But the problem is we (well, I anyway) don't want to just shut up all 
the warnings, but only the ones we know are OK.  We want the complaint 
to show up when it's an unintentional unused parameter.

If there's no way to do that with msvc, oh well, but if we can do 
something for gcc then at least those of us using it can detect when 
there is a problem.


More information about the Bf-committers mailing list