[klibc] [PATCH] fix warnings with GCC 10

Ben Hutchings ben at decadent.org.uk
Sat Jul 25 10:04:14 PDT 2020


On Thu, 2020-06-18 at 17:05 +0000, Christophe Leroy wrote:
> Many warnings are encountered with GCC 10. Fix them.
> 
> Signed-off-by: Christophe Leroy <christophe.leroy at csgroup.eu>
> ---
>  usr/dash/eval.c          |  2 +-
>  usr/klibc/zlib/infback.c |  2 +-
>  usr/klibc/zlib/inflate.c | 20 ++++++++++++++++++++
>  3 files changed, 22 insertions(+), 2 deletions(-)
> 
> diff --git a/usr/dash/eval.c b/usr/dash/eval.c
> index dd144948a9fa..6b2b01e19a47 100644
> --- a/usr/dash/eval.c
> +++ b/usr/dash/eval.c
> @@ -274,7 +274,7 @@ checkexit:
>  			n->nbinary.ch1,
>  			(flags | ((isor >> 1) - 1)) & EV_TESTED
>  		);
> -		if (!exitstatus == isor)
> +		if ((!exitstatus) == isor)
>  			break;
>  		if (!evalskip) {
>  			n = n->nbinary.ch2;

This warning has been around for several gcc versions.  I want to fix
it but I also don't want to apply more patches that diverge from
upstream dash (where this has been fixed, but on top of another change
to this line).

I'm tempted to suppress the warning for now.

> diff --git a/usr/klibc/zlib/infback.c b/usr/klibc/zlib/infback.c
> index 455dbc9ee843..be5eace3ad1a 100644
> --- a/usr/klibc/zlib/infback.c
> +++ b/usr/klibc/zlib/infback.c
> @@ -460,7 +460,7 @@ void FAR *out_desc;
>              }
>              Tracev((stderr, "inflate:       codes ok\n"));
>              state->mode = LEN;
> -
> +	    /* fallthrough */
>          case LEN:
>              /* use inflate_fast() if we have enough input and output */
>              if (have >= 6 && left >= 258) {
> diff --git a/usr/klibc/zlib/inflate.c b/usr/klibc/zlib/inflate.c
> index 792fdee8e9c7..0a706208cf4c 100644
> --- a/usr/klibc/zlib/inflate.c
> +++ b/usr/klibc/zlib/inflate.c
> @@ -649,6 +649,7 @@ int flush;
>              if (state->flags & 0x0200) CRC2(state->check, hold);
>              INITBITS();
>              state->mode = TIME;
> +	    /* fallthrough */
>          case TIME:
>              NEEDBITS(32);
>              if (state->head != Z_NULL)
[...]

This is a similar situation.  Have this changes been submitted to <
https://github.com/madler/zlib>?  I couldn't see any sign of an issue
or PR for these warnings.

(I really should update zlib to the latest release first, as it has had
other more important fixes since, er, 2006.)

Ben.

-- 
Ben Hutchings
Anthony's Law of Force: Don't force it, get a larger hammer.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part
URL: <https://lists.zytor.com/archives/klibc/attachments/20200725/0f3fd9f5/attachment-0001.sig>


More information about the klibc mailing list