Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date: Sat, 10 Jul 2021 13:00:36 -0400
From: Rich Felker <dalias@...c.org>
To: musl@...ts.openwall.com
Subject: Re: [PATCH 2/2] add -Wtype-limits to enabled warning list

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.

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.