bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#49261: Segfault during loadup


From: Paul Eggert
Subject: bug#49261: Segfault during loadup
Date: Tue, 13 Jul 2021 18:12:00 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0

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;

and these declarations have well-defined behavior in C, so -Woverflow should not issue warnings for them even though they are unsigned conversions that change numeric values.

It might be useful to some programmers to generate warnings about these unsigned conversions, but this should be a separate -W option not -Woverflow. There's no overflow here.






reply via email to

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