https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96788
Xi Ruoyao <xry111 at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |xry111 at gcc dot gnu.org --- Comment #9 from Xi Ruoyao <xry111 at gcc dot gnu.org> --- (In reply to newbie-02 from comment #8) > fell into same / similar: > "long x1li = -9223372036854775808;" produces a warning: > "integer constant is so large that it is unsigned". > > Assume it's the same root in: > #7826 Decimal constant -2147483648 cause a warning "decimal constant is so > large that it is unsigned", and > #84764 Wrong warning "so large that it is unsigned" for __int128 constant > > the literal is "split evaluated" in sign and value, the value part of > LONG_MIN is 1 too big to fit into a positive LONG, thus the warning. > > Consider it misleading, technically wrong and annoying, think a fix should > be trivial, first account the sign, then issue warning ( if any ). > > Could please someone set to NEW? > > :-) No, in C there's NOT a negative integer constant, at all. So you cannot account the sign for an integer constant. For -9223372036854775808 you are applying an unary - operator on the integer constant 9223372036854775808, which is so large that it is unsigned. Thus the warning is correct. See the resolution of PR 7826. It may be not correct for the case in comment 0 though.