[Bug c/97884] INT_MIN falsely expanded to 64 bit

2020-11-18 Thread schwab--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97884 --- Comment #11 from Andreas Schwab --- 2147483648 does not fit in 32 bits.

[Bug c/97884] INT_MIN falsely expanded to 64 bit

2020-11-18 Thread s.bauroth--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97884 --- Comment #10 from s.baur...@tu-berlin.de --- (In reply to Jonathan Wakely from comment #9) > (In reply to s.bauroth from comment #7) > > > The type of an integer constant is the first of the corresponding list > > > in which its value can be re

[Bug c/97884] INT_MIN falsely expanded to 64 bit

2020-11-18 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97884 --- Comment #9 from Jonathan Wakely --- (In reply to s.bauroth from comment #7) > > The type of an integer constant is the first of the corresponding list > > in which its value can be represented. > These kind of sentences make me think gcc's be

[Bug c/97884] INT_MIN falsely expanded to 64 bit

2020-11-18 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97884 --- Comment #8 from Jakub Jelinek --- If you design your own programming language, you can define it whatever way you want, but for C and C++ it is well defined how the compiler must behave in these cases, that -2147483648 are two separate tokens

[Bug c/97884] INT_MIN falsely expanded to 64 bit

2020-11-18 Thread s.bauroth--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97884 --- Comment #7 from s.baur...@tu-berlin.de --- I do understand that +2147483648 is not an int. I am aware of how the 2s complement works. It seems to me the reason for INT_MIN being '(-2147483647 - 1)' instead of the mathematically equivalent '-21

[Bug c/97884] INT_MIN falsely expanded to 64 bit

2020-11-18 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97884 --- Comment #6 from Jonathan Wakely --- The C standard says "The type of an integer constant is the first of the corresponding list in which its value can be represented." The corresponding list for decimal constants with no suffix is int, long i

[Bug c/97884] INT_MIN falsely expanded to 64 bit

2020-11-18 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97884 Jakub Jelinek changed: What|Removed |Added CC||jakub at gcc dot gnu.org --- Comment #5

[Bug c/97884] INT_MIN falsely expanded to 64 bit

2020-11-18 Thread s.bauroth--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97884 --- Comment #4 from s.baur...@tu-berlin.de --- I am aware of the warning, I disagree with it's content. INT_MIN is an int, not a long long int. I understand why it is processed as a long long int internally, but that should not be visible from the

[Bug c/97884] INT_MIN falsely expanded to 64 bit

2020-11-18 Thread msebor at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97884 Martin Sebor changed: What|Removed |Added CC||msebor at gcc dot gnu.org --- Comment #3

[Bug c/97884] INT_MIN falsely expanded to 64 bit

2020-11-18 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97884 Richard Biener changed: What|Removed |Added Status|UNCONFIRMED |RESOLVED Resolution|---

[Bug c/97884] INT_MIN falsely expanded to 64 bit

2020-11-17 Thread s.bauroth--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97884 --- Comment #1 from s.baur...@tu-berlin.de --- Created attachment 49584 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=49584&action=edit preprocessed source