From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 10C2B3858D39; Tue, 2 Apr 2024 16:16:50 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 10C2B3858D39 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1712074611; bh=5pzqzShRZ48i0LUXoPcuPEcHI+XeMni1sD2ZbDZBdC8=; h=From:To:Subject:Date:In-Reply-To:References:From; b=o24Tt5sDAHAnHbYjKdHxv454MXvioKQe8xvFfIXeAuIP6laiHG573xsgPL+6Lfm8V 5sVyPPoJ5nbzugG4q/7ellLac9HCc66TNf517bLdRcVGqYbaMBnHIt9G8/CxLwHqjE gJ2TiEZvHwk1VtLlysqkNxGztYogxcTE5QDIILnM= From: "harald at gigawatt dot nl" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/114526] ISO C does not prohibit extensions: fix misconception. Date: Tue, 02 Apr 2024 16:16:50 +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: 14.0 X-Bugzilla-Keywords: diagnostic, documentation X-Bugzilla-Severity: normal X-Bugzilla-Who: harald at gigawatt dot nl X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: DUPLICATE 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=3D114526 --- Comment #9 from Harald van Dijk --- (In reply to Joseph S. Myers from comment #8) > "rejects", in the ISO C sense, only applies to errors and pedwarns in GCC; > not to warnings conditional on -pedantic (of which there are also some, b= ut > which don't turn into errors with -pedantic). >=20 > If you have cases where something that is only *undefined as a property o= f a > particular execution of the program* (as opposed to undefined as a proper= ty > of a translation unit or of the collection of translation units making up= a > program, or violating a Constraint or syntax rule) but that are errors or > pedwarns, those should be reported as separate bugs. Bug 83584, which like this one is closed as a duplicate of 11234, is about exactly that. void *f(void) { return (void *)f; } int main(void) { return 0; } This is a strictly conforming program. It violates no syntax rule or constraint, and exhibits no translation-time undefined behaviour, yet it triggers a pedwarn, turning into an error with -pedantic-errors. It would h= ave undefined behaviour i f f were ever called, but it is not called.=