From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 00DC7387084B; Wed, 26 Aug 2020 22:55:55 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 00DC7387084B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1598482556; bh=wY4QcRQmXVGPDSLHkx8KX2LQhPeIcDH+aVyjveykvB8=; h=From:To:Subject:Date:In-Reply-To:References:From; b=U1llauQUcLmuMJL5DNf6lNmOj35GPCeXApSq4XwWzeZWYqVoK+jlXFIHYFtsqHRFk I48USj5tNQmIndXmue4xR/CsQ+IdMEm3M/PXpW4ypdDPnR04iWyiUAzC2OysxuGEbw ofOTmvBeqtuqNW3bVEwt5HUVUGA3g0unKZN1Jo0A= From: "joseph at codesourcery dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/96788] "integer constant is so large that it is unsigned" warning is incorrect Date: Wed, 26 Aug 2020 22:55:55 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c X-Bugzilla-Version: 11.0 X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: normal X-Bugzilla-Who: joseph at codesourcery dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Aug 2020 22:55:56 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D96788 --- Comment #5 from joseph at codesourcery dot com --- The way GCC actually behaves is that this constant is unsigned in the=20 preprocessor but signed outside the preprocessor. I'm not sure that's=20 exactly intent (though the preprocessor having only a single signed and=20 unsigned type, with this constant not fitting in the signed type, means it= =20 couldn't be interpreted as signed in the preprocessor if allowed in #if=20 expressions at all). The warnings are attempting to cover both the C90=20 case where a decimal constant too large for signed long can be unsigned=20 long, and the case of a constant too large for intmax_t.=