From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 0E40E3858D28; Wed, 25 Jan 2023 09:45:35 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0E40E3858D28 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1674639935; bh=nobE+jETvj69rWYhMHVR5jpS+ZrTU6PA2plZjVglDSI=; h=From:To:Subject:Date:In-Reply-To:References:From; b=vZVHHhjAgK+bGpMo3mcYsjHCRWmg/JXIAr5BF73M0NS0pwP0tdUwsLNdH+JRtaV/t E6s9IHOtJGG4fhkskeDC4n4KhREnkI8mmeZCpZKMtlxV3MGwiEHkMUk1lS9oemOBbf KB5gb1m++ixVBLZ/I4/9arFnWBMVWAiRNBZmwJWw= From: "daniel.lundin.mail at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/84764] Wrong warning "so large that it is unsigned" for __int128 constant Date: Wed, 25 Jan 2023 09:45:31 +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: 7.3.0 X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: normal X-Bugzilla-Who: daniel.lundin.mail at gmail 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: cc 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D84764 Daniel Lundin changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |daniel.lundin.mail at gmai= l dot co | |m --- Comment #3 from Daniel Lundin --- This is a bug as in the wrong text is displayed in the diagnostic message. = gcc picks `__int128` and it is not an unsigned type. Decimal integer constants use the the quoted list in 6.4.4.1: `int` then `l= ong` then `long long`. Therefore this normative text (from C99 to C23) applies: = "If all of the types in the list for the constant are signed, the extended inte= ger type shall be signed." gcc behaves just like required too, since `__int128` ought to be one of the extended integer types and it is signed. I would guess this message is some remain from C90 where extended integer t= ypes didn't exist. Compiling with -std=3Dc90 adds an additional warning "warning= : this decimal constant is unsigned only in ISO C90". It would appear that this is= the correct warning that should always be displayed. Seems to be a minor bug th= at occurred during the switch (gcc 5.0.0) from gnu90 to gnu11 as default optio= n.=