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

Dieter BSD dieterbsd at engineer.com
Mon May 30 22:44:00 UTC 2011


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.

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


More information about the freebsd-toolchain mailing list