Wireshark-dev: Re: [Wireshark-dev] Prevent compiler warnings by using "stop on warnings"/"treat
On Tue, Mar 20, 2007 at 03:04:49AM +0100, Ulf Lamping wrote:
> In my experience having a compiler warning free code is a good way to
> prevent very subtle bugs and would also be a good addition to the
> programs security - and BTW more pleasant to work with ;-)
Indeed.
> So here comes the buildbot into the scene. If we would use a compiler
> option like "stop on warnings" (or "treat warnings as errors" or
> alike), it would become at least much more obvious if new warnings
> were added - the buildbot will get "red". This will also make the time
> when a warning is noticed much nearer to the time the code was
> added/changed - currently fixing a warning once added is often done
> much later than it was introduced (making the fix unnecessarily
> difficult).
> An incremental way to introduce this could be:
Good ideas!
> As usual, this is my "Win32 point of view". I'm pretty sure the above
> is possible to do for the Win32 platform. I'm not sure if it's
> possible with the automake foo for the different unix/linux platform
> builds ...
With automake, we just need to put AM_CFLAGS = -Werror in the
Makefile.am file in each directory that we're working on.
> So what's the opinion about this way to improve the Wireshark code
> base? Are we willing to produce only warning free code and fixing
> warnings that appear on the buildbot?
Yes.
> While I would take a look on the Win32 warnings, are the unix/linux
> developers willing to spend some time to remove warnings that don't
> appear on Win32 (or would this be a "Win32 only" show)?
I'm willing to work on the Unix warnings.
Steve