compiler warnings (was: Re: [rfc] a few kern.mk and bsd.sys.mk related changes)

Dieter BSD dieterbsd at engineer.com
Tue May 31 23:39:17 UTC 2011


>> please keep in mind that -Wfoo does reflect the ideas of the GNU people
>> regarding *proper* code. the warnings themselves are sometimes wrong,
>> because they complain about perfectly correct code.

I attempted to get the gcc people to improve this:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=9072

Most of the warnings I see are either due to someone thinking
all the world is ILP32 and doing things like storing a 64 bit
pointer or long in a 32 bit int, or due to the compiler needing
more info to insure that they are not trying to stuff 64 bits into
32, such as missing prototypes.  Either way it needs to be fixed.

In many cases the developers that claim to write such great code,
and claim that the compiler warnings don't matter are the ones
whose code has the most bugs (seg faults, floating point exceptions, ...).

> Pretty much the entire kernel is compiled
> with quite a large number of warning classes enabled, and -Werror set, for
> example.

Whoever did this, THANK YOU!!!

> fixing warnings in other people's code is useful only if
> you can get them to accept the fixes back

Fixing bugs is always useful.  Certainly it is a *lot* more
efficient if you can get them fixed at the source rather than
having to maintain patches.


More information about the freebsd-hackers mailing list