From owner-freebsd-toolchain@FreeBSD.ORG Tue May 31 11:16:47 2011 Return-Path: Delivered-To: freebsd-toolchain@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1233) id AA6C3106566C; Tue, 31 May 2011 11:16:47 +0000 (UTC) Date: Tue, 31 May 2011 11:16:47 +0000 From: Alexander Best To: Dieter BSD Message-ID: <20110531111647.GA7168@freebsd.org> References: <20110530224357.95220@gmx.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20110530224357.95220@gmx.com> Cc: freebsd-hackers@freebsd.org, freebsd-toolchain@freebsd.org Subject: Re: compiler warnings (was: Re: [rfc] a few kern.mk and bsd.sys.mk related changes) X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 May 2011 11:16:47 -0000 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