From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 10CAD3858006; Tue, 17 Nov 2020 22:19:33 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 10CAD3858006 From: "jsm28 at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/97882] [8/9/10/11 Regression] Segmentation Fault on improper redeclaration of function Date: Tue, 17 Nov 2020 22:19:32 +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: 10.2.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: jsm28 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: 8.5 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cf_reconfirmed_on target_milestone bug_status short_desc everconfirmed 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: Tue, 17 Nov 2020 22:19:33 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D97882 Joseph S. Myers changed: What |Removed |Added ---------------------------------------------------------------------------- Last reconfirmed| |2020-11-17 Target Milestone|--- |8.5 Status|UNCONFIRMED |NEW Summary|Segmentation Fault on |[8/9/10/11 Regression] |improper redeclaration of |Segmentation Fault on |function |improper redeclaration of | |function Ever confirmed|0 |1 --- Comment #1 from Joseph S. Myers --- Looks like a regression in GCC 7 relative to GCC 6. Whether this code is v= alid or invalid GNU C is a tricky question, but I'm inclined to say that when the incomplete enum type extension is used, we should *not* count such enums as compatible with unsigned int since we don't know what members the enum will have once completed. So, for example, I think we ought to reject extern enum foo *x; unsigned int *x; and certainly ought to reject extern enum foo *x; unsigned int *x; enum foo { A =3D -1 }; where the enum ends up compatible with int rather than unsigned int. (But a patch involving rejecting such code might not be such a good idea for backporting, given the risk of breaking user programs that build OK with the release branch compilers.) (A C11 defect fix incorporated in C17 means a qualifier on a function return type is ignored, so whether the code is valid is not affected by the "const= " in the original test case.)=