From: Rich Felker <dalias@libc.org>
To: musl@lists.openwall.com
Subject: Re: [musl] [PATCH 2/2] add -Wtype-limits to enabled warning list
Date: Sat, 10 Jul 2021 13:00:36 -0400 [thread overview]
Message-ID: <20210710170035.GV13220@brightrain.aerifal.cx> (raw)
In-Reply-To: <20210710032500.9249-2-ericonr@disroot.org>
On Sat, Jul 10, 2021 at 12:25:00AM -0300, Érico Nogueira wrote:
> this warning catches conditionals which are never true, such as checking
> if an unsigned value is smaller than zero. this leads to two warnings in
> the getgr_a.c and getpw_a.c files, which assume that the underlying type
> for gid_t and uid_t might still change.
> ---
> configure | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/configure b/configure
> index a5231a0e..b7beaeab 100755
> --- a/configure
> +++ b/configure
> @@ -546,6 +546,7 @@ tryflag CFLAGS_AUTO -Winit-self
> tryflag CFLAGS_AUTO -Wreturn-type
> tryflag CFLAGS_AUTO -Wsequence-point
> tryflag CFLAGS_AUTO -Wstrict-aliasing
> +tryflag CFLAGS_AUTO -Wtype-limits
> tryflag CFLAGS_AUTO -Wunused-function
> tryflag CFLAGS_AUTO -Wunused-label
> tryflag CFLAGS_AUTO -Wunused-variable
> --
> 2.32.0
I probably won't adopt this, since it necessarily breaks generic
(macro) or underlying-type-agnostic code written to be safe with both
signed and unsigned types.
prev parent reply other threads:[~2021-07-10 17:00 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-10 3:24 [musl] [PATCH 1/2] fix error checking in pthread_getname_np Érico Nogueira
2021-07-10 3:25 ` [musl] [PATCH 2/2] add -Wtype-limits to enabled warning list Érico Nogueira
2021-07-10 17:00 ` Rich Felker [this message]
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=20210710170035.GV13220@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).