We're in the middle of tidying up our codebase by (among other things) fixing all the compiler warnings.
The end goal is to turn on the flag that converts all warnings to errors. We've run into a slight snag with system and thirdparty headers. Some of the system headers cause the various compilers to emit warnings. Now obviously we can't go modifying system headers to fix those warnings.
With the intel compiler (and gcc) you simply use -isystem instead of -I when building up the include path to tell the compilers that headers in those dirs are system headers and it stops warning about them. Then it's a simple matter of turning on the -Werror flag.
We're also using Sun Studio 12, the flag -errwarn=%all should be the equivalent of -Werror, but I can't find a way to tell the compiler to ignore warnings in system / thirdparty headers. There is the -errhdr flag, but this doesn't seem to do what I want.
Does anyone know how to accomplish this with Sun Studio 12?
Another option is to look at the warning tag using -errtags, and then switch off the particular warning with -erroff.