poke-devel
[Top][All Lists]
Advanced

[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.






reply via email to

[Prev in Thread] Current Thread [Next in Thread]