From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/7803 Path: news.gmane.org!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: More on warning cleanup Date: Thu, 28 May 2015 01:08:53 -0400 Message-ID: <20150528050853.GA8590@brightrain.aerifal.cx> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1432789760 25913 80.91.229.3 (28 May 2015 05:09:20 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 28 May 2015 05:09:20 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-7815-gllmg-musl=m.gmane.org@lists.openwall.com Thu May 28 07:09:13 2015 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1Yxq49-0001U6-D8 for gllmg-musl@m.gmane.org; Thu, 28 May 2015 07:09:13 +0200 Original-Received: (qmail 5309 invoked by uid 550); 28 May 2015 05:09:11 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 5265 invoked from network); 28 May 2015 05:09:07 -0000 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Original-Sender: Rich Felker Xref: news.gmane.org gmane.linux.lib.musl.general:7803 Archived-At: Since compilers differ in what warnings they include in -Wall, I'd like to remove -Wall (followed by a bunch of -Wno-*) from musl's --enable-warnings and instead individually turn on the warnings we want. A few weeks ago I worked those out on #musl (based on the GCC manual's documentation of -Wall and other options) and here's what I came up with: -Waddress -Warray-bounds -Wchar-subscripts -Wreturn-type -Wsequence-point -Wstrict-aliasing -Wstrict-overflow -Wunused-function -Wunused-variable -Wunused-label This list does not include the ones we already have as errors because they only trigger on invalid C: -Werror=implicit-function-declaration -Werror=implicit-int -Werror=pointer-sign -Werror=pointer-arith Are these any other warnings we should enable? I specifically don't want any from the following list which we're explicitly turning off after using -Wall right now: -Wparentheses -Wuninitialized -Wmissing-braces -Wunused-value -Wunused-but-set-variable -Wunknown-pragmas -Wpointer-to-int-cast Note that the list of warnings to disable after -Wall is almost as long as my list of desirable warnings to enable. One other issue to consider is how to get rid of enabled-by-default warnings we don't want. On GCC they're impossible to turn off individually, but unobtrusive; only -w can turn them off, but -w is permanent and overrides all later -W options. On cparser, a lot of crap is turned on by default, but -w turns it off and is then overridable by subsequent -W options. Not sure about clang. Rich