From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id F0BFA3854174; Mon, 31 Oct 2022 14:18:02 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org F0BFA3854174 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1667225882; bh=xzL4saO2J6kGjpI9CgY2LQga4RoSH++gxXivgTePK9g=; h=From:To:Subject:Date:In-Reply-To:References:From; b=sKS+KhYpsRtpXK8/eu+rNGuDgRf6YBSVaOa1wPnxYWK+EoAJ+FHqb8VKqTbdwfTYS TaE5rZF2Ibo3tGPOsxNh9WNzOtUXw1YJUv88lDLiGtZ/kz3tDAJXCzO16gByPIvaZe tnG+m3lKR8qdkqv29mdnZUsr1cTi59VFanwAaC5U= From: "vincent-gcc at vinc17 dot net" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/105499] inconsistency between -Werror=c++-compat and g++ in __extension__ block Date: Mon, 31 Oct 2022 14:17:56 +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: 11.3.0 X-Bugzilla-Keywords: documentation X-Bugzilla-Severity: normal X-Bugzilla-Who: vincent-gcc at vinc17 dot net 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=3D105499 --- Comment #6 from Vincent Lef=C3=A8vre --- To be clear... I'm not sure about what kind of compatibility warnings one c= an get, but it is OK to silence valid extensions, i.e. those that will not giv= e an error. But invalid extensions, i.e. those that would give an error with a compat-implied compiler (like in the testcase), should not be silenced by __extension__. The problem is that in my original testcase, __extension__ was used in orde= r to silence the warning for the ({...}) construct, which is still valid with g+= +. But as a side effect, it also silences the conversion from the "int *p =3D = q;", which is invalid in C++ (and is actually *not* an extension as it fails as shown in my bug report).=