From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 304AC3858C41; Sun, 11 Feb 2024 18:21:37 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 304AC3858C41 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1707675697; bh=s7HAOF0A119ShgFD0wCDizDRi8rYeAtCIvS+m9PsAV8=; h=From:To:Subject:Date:In-Reply-To:References:From; b=eFaYaIzbtzmHvKSoJrMkcwb8K0OOsn84zSkp4VnsHjoTz2JJw7lPWZGxAFDy6/v9J Y0yUTHBqyBzI85Zydd9SmD7Z2WPzIqCVOaou3ZCnB3FnOAq8I2YUbsnwi2JCp63sBP nmD/ikP2sQo3dTyVN3Y0ApglBfSXHj2iyM9wb6Q4= From: "carlosgalvezp at gmail dot com" To: gdb-prs@sourceware.org Subject: [Bug gdb/31331] Wenum-constexpr-conversion should be fixed, soon treated as a hard error Date: Sun, 11 Feb 2024 18:21:37 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: gdb X-Bugzilla-Version: HEAD X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: carlosgalvezp at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: 15.1 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://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://sourceware.org/bugzilla/show_bug.cgi?id=3D31331 --- Comment #27 from Carlos Galvez --- There's 2 orthogonal issues: - C enums have implementation-defined underlying type. - C enums get promoted to signed ints when operating arithmetically (well-defined behavior, specified in the Standard). If we change the logic of the code from detecting "is enum unsigned" to detecting "will enum be promoted to signed int" then there shouldn't be any implementation-defined behavior and the code should behave identically under all compilers. --=20 You are receiving this mail because: You are on the CC list for the bug.=