public inbox for newlib@sourceware.org
 help / color / mirror / Atom feed
From: Corinna Vinschen <vinschen@redhat.com>
To: newlib@sourceware.org
Subject: Re: -Wall
Date: Wed, 24 Jan 2024 12:19:54 +0100	[thread overview]
Message-ID: <ZbDyWgQXdRhOV5-q@calimero.vinschen.de> (raw)
In-Reply-To: <c8e0990e-2813-4490-945e-09166d6c4e11@systematicsw.ab.ca>

On Jan 23 22:38, brian.inglis@systematicsw.ab.ca wrote:
> On 2024-01-20 11:17, brian.inglis@systematicsw.ab.ca wrote:
> > On 2024-01-19 05:55, Corinna Vinschen wrote:
> > > if you saw my today's pushes, you're aware that I only found a bug
> > > because I used -Wall.  I fixed the bug and a few less crucial warnings.
> > > I did NOT fix the warnings in code we took verbatim from some BSDs,
> > > which often contain unused variables, or in some cases expressions which
> > > are deemed to profit from extra paranthesis, e. g.
> > >    if (a >= 0 ^ b == 0)
> > > For that reason, I'd like to suggest to add -Wall by default to the
> > > build flags for newlib, just as it is already for ages in the Cygwin
> > > tree.
> > > Anybody having a strong opinion, pro or contra?
> 
> > ++
> > I also like:
> >      -Wextra -Wformat=2 -Wformat-overflow=2 -Werror=format-security
> > to get more useful warnings, and error if there are security issues like
> > totally variable format strings; use `info gcc W...` for descriptions;
> > YL/100kmMV
> > I have also found the following work well for development with recent gcc:
> >      -fanalyzer -fsanitize-recover=all
> >      -fstack-check -fstack-protector-all
> >      --param=ssp-buffer-size=4
> > but may be inappropriate for production builds; use `info gcc f...` for
> > descriptions.
> 
> Linux added -Wstringop-overflow to diagnose provable buffer overflows,
> except with GCC == 11 which mishandles the test:
> 
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=610347effc2ecb5ededf5037e82240b151f883ab
> 
> For extra Linux warning flags W=1/2/3 available see:
> 
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/scripts/Makefile.extrawarn

This is going a tad bit too far.  I was just asking if we should add
-Wall unconditionally.

I'm fully aware that this doesn't cover all possible warnings an
over-protective compiler can generate, but this is, IMHO, a medium
sized compromise.

Ok or not?


Corinna


  reply	other threads:[~2024-01-24 11:19 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-19 12:55 -Wall Corinna Vinschen
2024-01-19 15:38 ` -Wall Mike Frysinger
2024-01-19 15:55   ` -Wall Joel Sherrill
2024-01-19 16:23 ` -Wall Liviu Ionescu
2024-01-19 18:34   ` -Wall Liviu Ionescu
2024-01-20 18:17 ` -Wall brian.inglis
2024-01-24  5:38   ` -Wall brian.inglis
2024-01-24 11:19     ` Corinna Vinschen [this message]
2024-01-24 11:25       ` -Wall Liviu Ionescu
2024-01-24 13:06         ` -Wall Corinna Vinschen
2024-01-21 11:41 ` -Wall Liviu Ionescu

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=ZbDyWgQXdRhOV5-q@calimero.vinschen.de \
    --to=vinschen@redhat.com \
    --cc=newlib@sourceware.org \
    /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.
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 read-only IMAP folder(s) and NNTP newsgroup(s).