Huge thanks to our Platinum Members Endace and LiveAction,
and our Silver Member Veeam, for supporting the Wireshark Foundation and project.

Wireshark-dev: Re: [Wireshark-dev] Prevent compiler warnings by using "stop on warnings"/"treat

From: Ulf Lamping <ulf.lamping@xxxxxx>
Date: Wed, 21 Mar 2007 13:08:08 +0100
Joerg Mayer wrote:
No, it won't work. I've spent many many hours in the past to get rid of
compiler warnings and it just won't work. While we definitely should try
to get rid of some warnings, fixing warnings on one platform may introduce
warnings on other platforms (or even gcc versions).
Yes, I know there are very special cases where you'll have real problems getting a warning free code on all platforms / compilers / versions.

One thing comes to my mind where this will be a problem: header files from our external libraries.

BTW: Having a piece of code that doesn't compile without warnings on all platforms (unless you've triggered a real compiler bug) is often a good candidate for a code redesign - if the compiler doesn't like it most human developers will often also have problems to understand it ;-)

But - these are really the exceptions and not the common thing.

Most warnings can be fixed without problems. Some warnings will need special handling as there's no way to fix it (without making the code even uglier), it might be necessary to exclude code paths (#pragma) or even complete files from the general rule, as there's no realistic way to fix this in any other way.

We might even need a configure option to disable the "warning as error" feature completely on platforms / compiler versions where this doesn't work.

However, my goal would be to get a warning free build on the buildbot platforms, as that would be a big step into the right direction and that would make the situation much better even for the "unsupported platforms" ...

Regards, ULFL