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

Alexander Best arundel at freebsd.org
Tue May 31 11:16:47 UTC 2011


On Mon May 30 11, Dieter BSD wrote:
> Chris writes:
> >> Ports need attention. The warnings I get there are frightening.
> >
> > I find it comforting that they're just that: warnings.
> >
> > How do they frighten you?
> 
> High quality code does not have any warnings.
> 
> The most frightening thing is the attitute that "They're just warnings,
> so I'll ignore them."  Most compiler warnings should be fatal errors.
> And a lot of the warnings that require a -Wwhatever should be on by
> default.

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. so -Wfoo should not be considered
a code verifier, but in fact what it is: a warning flag. sometimes it's correct
and indeed reports wrong code, sometimes it is completely wrong.

cheers.
alex

> 
> Code that doesn't compile cleanly often has other problems, like assuming
> that all CPUs are ILP32 little endian, like not checking return codes, etc.
> 
> But hey, the next time the weather service issues a tornado warning,
> feel free to go outside and fly a kite.  After all it's just a warning.
> 
> a13x writes:
> > -Wcoercion seems to have only been a SoC project in 2006 [1]. i checked gcc
> > trunk and it's not in the gcc(1) manual.
> >
> > [1] http://gcc.gnu.org/wiki/Wcoercion
> 
> And yet someone marked the bug fixed.
> 
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=9072

-- 
a13x


More information about the freebsd-hackers mailing list