[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Signed overflow Was: Re: GNU poke 2.0.92 with ubsan
From: |
Bruno Haible |
Subject: |
Re: Signed overflow Was: Re: GNU poke 2.0.92 with ubsan |
Date: |
Mon, 07 Feb 2022 17:55:32 +0100 |
Jose E. Marchesi wrote:
> So I tried with ubsan with your patch, plus these changes:
Looks good.
> However, the changes in pkl-fold.c trigger a compile-time warning
> (-Woverflow) in the gnulib macros INT_*_OVERFLOW.
>
> This is one of these warnings:
>
> In file included from ../../gl-libpoke/xalloc.h:27:0,
> from ../../libpoke/pkl-fold.c:28:
> ../../libpoke/pkl-fold.c: In function 'pkl_fold_or':
> ../../gl-libpoke/intprops.h:310:65: warning: integer overflow in expression
> [-Woverflow]
> : (a) % (_GL_INT_CONVERT (a, _GL_SIGNED_INT_MAXIMUM (b)) + 1)) \
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~
> ../../gl-libpoke/intprops.h:300:19: note: in expansion of macro
> '_GL_UNSIGNED_NEG_MULTIPLE'
> : (b) < 0 && ! _GL_UNSIGNED_NEG_MULTIPLE (a, b, max))
> ^~~~~~~~~~~~~~~~~~~~~~~~~
> ../../gl-libpoke/intprops.h:388:3: note: in expansion of macro
> '_GL_REMAINDER_OVERFLOW'
> op_result_overflow (a, b, \
> ^~~~~~~~~~~~~~~~~~
> ../../gl-libpoke/intprops.h:378:3: note: in expansion of macro
> '_GL_BINARY_OP_OVERFLOW'
> _GL_BINARY_OP_OVERFLOW (a, b, _GL_REMAINDER_OVERFLOW)
> ^~~~~~~~~~~~~~~~~~~~~~
> ../../libpoke/pkl-fold.c:613:23: note: in expansion of macro
> 'INT_REMAINDER_OVERFLOW'
> if (INT_REMAINDER_OVERFLOW (op1_val, \
Hmm. I recall that some warnings may occur in dead code in intprops.h,
depending on GCC versions. This doesn't look serious to me. But will follow up.
- Re: GNU poke 2.0.92 on arm, (continued)
- Re: GNU poke 2.0.92 on arm, Bruno Haible, 2022/02/06
- Re: GNU poke 2.0.92 on mips, Bruno Haible, 2022/02/06
- Re: GNU poke 2.0.92 on x86_64-{32,x32}, Bruno Haible, 2022/02/06
- Re: GNU poke 2.0.92 on alpha, Bruno Haible, 2022/02/06
- Re: GNU poke 2.0.92 with ubsan, Bruno Haible, 2022/02/06
- Re: GNU poke 2.0.92 with ubsan, Mohammad-Reza Nabipoor, 2022/02/06
- Re: GNU poke 2.0.92 with ubsan, Bruno Haible, 2022/02/06
- Re: GNU poke 2.0.92 with ubsan, Bruno Haible, 2022/02/06
- Re: GNU poke 2.0.92 with ubsan, Jose E. Marchesi, 2022/02/07
- Signed overflow Was: Re: GNU poke 2.0.92 with ubsan, Jose E. Marchesi, 2022/02/07
- Re: Signed overflow Was: Re: GNU poke 2.0.92 with ubsan,
Bruno Haible <=
- Re: Signed overflow Was: Re: GNU poke 2.0.92 with ubsan, Jose E. Marchesi, 2022/02/07
Re: GNU poke 2.0.92 on s390x, Bruno Haible, 2022/02/06
Re: GNU poke 2.0.92 on riscv64, Bruno Haible, 2022/02/06