mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Rich Felker <dalias@libc.org>
To: musl@lists.openwall.com
Subject: More on warning cleanup
Date: Thu, 28 May 2015 01:08:53 -0400	[thread overview]
Message-ID: <20150528050853.GA8590@brightrain.aerifal.cx> (raw)

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


             reply	other threads:[~2015-05-28  5:08 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-28  5:08 Rich Felker [this message]
2015-05-28  6:55 ` Alex Dowad
2015-05-28  7:29   ` Rich Felker
2015-05-28 13:57 ` Shiz
2015-05-28 17:18   ` Rich Felker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150528050853.GA8590@brightrain.aerifal.cx \
    --to=dalias@libc.org \
    --cc=musl@lists.openwall.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).