From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 61BB9395ACCE; Wed, 30 Jun 2021 15:30:59 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 61BB9395ACCE From: "msebor at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: =?UTF-8?B?W0J1ZyB0cmVlLW9wdGltaXphdGlvbi8xMDEyNzJdIFsxMiBSZWdy?= =?UTF-8?B?ZXNzaW9uXSBlcnJvcjog4oCYbm9ubnVsbOKAmSBhcmd1bWVudCDigJhtZXNz?= =?UTF-8?B?YWdl4oCZIGNvbXBhcmVkIHRvIE5VTEwgWy1XZXJyb3I9bm9ubnVsbC1jb21w?= =?UTF-8?B?YXJlXSBzaW5jZSByMTItMTgwNQ==?= Date: Wed, 30 Jun 2021 15:30:59 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: 12.0 X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: normal X-Bugzilla-Who: msebor at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED 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: short_desc keywords 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: Wed, 30 Jun 2021 15:30:59 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D101272 Martin Sebor changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|[12 Regression] error: |[12 Regression] error: |=E2=80=98nonnull=E2=80=99 argument |=E2=80=98n= onnull=E2=80=99 argument |=E2=80=98message=E2=80=99 compared to NULL |=E2=80=98m= essage=E2=80=99 compared to NULL |[-Werror=3Dnonnull-compare] |[-Werror=3Dnonnull-compa= re] |since |since r12-1805 Keywords| |diagnostic --- Comment #1 from Martin Sebor --- The warning is valid and expected. It started to be issued with r12-1805.= =20 Prior to that, the parentheses around the inequality expression suppressed = it, like so: $ cat t.C && cc1plus.r12-1804 -quiet -Wall -Werror -o/dev/null t.C __attribute__ ((nonnull)) void f (int *p) { p =3D=3D 0 ? __builtin_abort () : (void)0; } __attribute__ ((nonnull)) void g (int *p) { (p =3D=3D 0) ? __builtin_abort () : (void)0; } t.C: In function =E2=80=98void f(int*)=E2=80=99: t.C:2:21: error: =E2=80=98nonnull=E2=80=99 argument =E2=80=98p=E2=80=99 com= pared to NULL [-Werror=3Dnonnull-compare] 2 | f (int *p) { p =3D=3D 0 ? __builtin_abort () : (void)0; } | ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ cc1plus.r12-1804: all warnings being treated as errors=