Subject: Re: bug#49261: Segfault during loadup

From: Eli Zaretskii <[email-masked]>
Date: Wed, 14 Jul 2021 15:36:11 +0300

> Cc: [email-masked], [email-masked]
> From: Paul Eggert <[email-masked]>
> Date: Tue, 13 Jul 2021 18:12:00 -0500
> 
> On 7/12/21 10:54 AM, Eli Zaretskii wrote:
> > Then what is the -Woverflow option for?  Can you show an example of
> > code which -Woverflow would flag that doesn't produce a bogus warning?
> 
> Sure: the GCC documentation says -Woverflow is supposed to warn about 
> "compile-time overflow in constant expressions". So GCC should (and
> does) warn about this top-level declaration:
> 
> int x = INT_MAX + 1;
> 
> However, there is no overflow here:
> 
> unsigned a = -1, b = INT_MIN, c = LLONG_MAX;

You are saying that there's some fundamental difference between

  INT_MAX + 1

and

  (USE_LSB_TAG ? - (1 << GCTYPEBITS) : VAL_MAX)

?  Or between an expression 'x = FOO' and 'mask = BAR'?  I don't see
any fundamental difference.  IMO, the warning was valid, as the
assignment loses significant bits.