From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 2EC0F3889E3A; Wed, 26 Oct 2022 08:21:09 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2EC0F3889E3A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1666772477; bh=y8jwTzadq8bfeAkgYf43Hdu/C5k1QYlrsnvLeKyZgNg=; h=From:To:Subject:Date:In-Reply-To:References:From; b=Udo3k4kDjX6nXVd3NfVLupi/JCH1uHG6DegRzlKkiY6T2phfyVWxRP3gqBioIUjFH KDeygKyZ+ATGrLkMBLgh0f9XImAJY6F+bFXhxhhfqAcxO/+6IgwQ+9mtDIKRhHwmoN RhfzNItA0rH3YSI/glxR1UpkeW53kjxqcyiErxJ0= From: "redi at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/107405] enums can be wrongly long in gcc-13 (in gnu99) Date: Wed, 26 Oct 2022 08:21:08 +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: 13.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: redi at gcc dot gnu.org X-Bugzilla-Status: NEW 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D107405 --- Comment #9 from Jonathan Wakely --- (In reply to Jiri Slaby from comment #4) > Another question is why B is affected by A at all? Also sizeof of that en= um > (if one gives it a name) is 8 with gcc-13. That is not allowed by the > standard, IMO. C99, C11, and C17 all say: "The expression that defines the value of an enumeration constant shall be = an integer constant expression that has a value representable as an int." So enum { A =3D 0xffffffff } is a constraint violation and not allowed by t= he standard anyway. Such code was always non-conforming and relying on an (undocumented?) GCC extension, so the standard has nothing to say about the type.=