Wireshark-dev: Re: [Wireshark-dev] Prevent compiler warnings by using "stop on warnings"/"treat
I'm quite surprised of what you're saying. I don't know what exact
platforms you've tested and which compilers. But I'm working on a
simulator and a library of generic data structures which are more than
70.000 lines of code compiling without any warning since gcc-2.95 until
gcc-4.1.2 and for several platforms (32 or 64bits) : Linux (Debian,
Fedora, CentOS, Ubuntu?), Solaris, Mac OS X and Windows (Cygwin).
maybe we've not been confronted to all the tricky gcc warnings ;)
Regards,
Sebastien Tandel
Joerg Mayer wrote:
> On Tue, Mar 20, 2007 at 01:01:20PM -0700, Stephen Fisher wrote:
>
>>> 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!
>>
>
> 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).
>
>
>> With automake, we just need to put AM_CFLAGS = -Werror in the
>> Makefile.am file in each directory that we're working on.
>>
>
> Yes, it can be technically done, but not in reality.
>
>
>>> 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?
>>>
>
> Not possible.
>
>
>> I'm willing to work on the Unix warnings.
>>
>
> I've been doing that for a rather long time and mostly (but not
> completely) stopped doing that about a year ago. Attached you'll find a
> rather hackish script that I use to "classify" the warnings. Maybe
> someone is willing to convert this into something less inefficient and
> much more readable...
>
> Ciao
> Joerg
>
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Wireshark-dev mailing list
> Wireshark-dev@xxxxxxxxxxxxx
> http://www.wireshark.org/mailman/listinfo/wireshark-dev
>