Gregory Reid

Side Effects of "-w iserror" C++ compiler switch on Wii CodeWarrior compiler

Discussion created by Gregory Reid on Aug 28, 2008
Latest reply on Sep 2, 2008 by Tom Thompson
I am using the CodeWarrior C++ compiler (version 3.1-2) for the Wii game console development kit.  Hopefully, this is a good place to post a question about compiler switches for this compiler.
 
We are using the  "-w iserror" compiler switch with the C++ compiler in order to treat warnings as errors (see page 52 of the "Build Tools Reference Revolution.pdf" file which documents this compiler switch for Wii CodeWarrior compiler build tools).  By "treating warnings as errors", I mean that the link should fail whenever there is at least one warning in the build -- just as it normally would stop when encountering at least one error.  (We would like to use this compiler switch to enforce a policy of not checking in changes into production code that produce warnings -- except for a few warnings we explicitly disable reporting for.)
 
The problem we are having is that -- at most --  one warning is reported in a source file when using the "-w iserror" compiler switch.
 
Here's an example of what I mean.  When I'm building a file called dvderror.c without the "-w iserror" switch, the following warnings are found:
 

    [cc] wbl_dvderror.c

    wbl_dvderror.c(662):  warning: (10182) variable / argument 'yChar' is not used in function

    wbl_dvderror.c(661):  warning: (10182) variable / argument 'xChar' is not used in function

    wbl_dvderror.c(660):  warning: (10182) variable / argument 'image' is not used in function

    [Link succeeded]

 
When using the switch I only get one warning as follows -- even though there are really three warnings that should be displayed:
 

     [cc] -w noiserror wbl_dvderror.c

     wbl_dvderror.c(662):  warning: (10182) variable / argument 'yChar' is not used in function

     [Link failed]

This seems to happen for all source files I've tested.

This side effect of "treating warnings as errors" is annoying because it means I need to disable the switch when I think I have multiple warnings in a file or leave the switch out altogether when doing new development.
 
Is this a known issue and does anyone know if there is a fix in the works or of a better workaround?  Thanks a lot!
 
-Greg Reid
Electronic Arts Tiburon -- Orlando, FL
 

Outcomes