From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id ACE703858CD1; Tue, 30 Apr 2024 16:52:52 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org ACE703858CD1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1714495972; bh=fdlofjGpreS5IiTHfKkd5xUtcw3M+yendYXmQrNIZsc=; h=From:To:Subject:Date:In-Reply-To:References:From; b=cTqwzSKDkRhIrrAAxKIAs+XxNlpOfXEqVY0ClQMZwFU/yA0ozz8oN4Ylo7R/koY9U 6kAAwl3PZuqPh05D2lLVcnPqbt7Pe/S9pbytM6optztc+8siMbOk0jPytYJ47S39N/ JrfhyvpS1ae0tGdeT9HrYiycpXzOZY+9RMMDXZX0= From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/61469] language feature: Support for enum underlying type Date: Tue, 30 Apr 2024 16:52:51 +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: unknown X-Bugzilla-Keywords: X-Bugzilla-Severity: enhancement X-Bugzilla-Who: pinskia at gcc dot gnu.org X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: FIXED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: jsm28 at gcc dot gnu.org X-Bugzilla-Target-Milestone: 13.0 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=3D61469 --- Comment #16 from Andrew Pinski --- (In reply to Thomas Mercier from comment #15) > No objection to the error message, but I would have expected a syntax err= or > for standards earlier than 23 which don't claim to support manually > specifying the underlying type for the enum. Like this with gcc 12: >=20 > test.c:1:21: error: expected identifier or =E2=80=98(=E2=80=99 before =E2= =80=98:=E2=80=99 token > 1 | enum node_stat_item : unsigned { Yes it is supported as an extension to older languages as the syntax does n= ot conflict with valid code. If you want an error for the extension you can use -Werror=3Dc11-c23-compat=