From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id BB46B38582BD; Tue, 11 Jul 2023 10:01:31 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BB46B38582BD DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1689069691; bh=GHK3p1c+GvqR3Q+wjhI0WBI5IRA/xGnYeHaI2w+QhJs=; h=From:To:Subject:Date:In-Reply-To:References:From; b=cHVCnkadNFm84eYvr2tP61HVI6HAiUQt5mT3qhaUsVm9Tqeh0BOhBV4ptO4h2KltA +I6LbHgq8wuXre7SeRkWY8pApOaBcaFmEuso1mjxxFrqQtYzNY20tNTwrM5aiGzgFC 12xqCY0FoQVI7RmwWzwzn1qz27SvLTSXM0l8zo5Q= From: "xry111 at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/110617] RFE: Add a diagnostic-only variant of nonnull attribute Date: Tue, 11 Jul 2023 10:01:31 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: middle-end X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: enhancement X-Bugzilla-Who: xry111 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: 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=3D110617 --- Comment #10 from Xi Ruoyao --- (In reply to Florian Weimer from comment #9) > (In reply to Xi Ruoyao from comment #6) > > (In reply to Richard Biener from comment #5) > > > I think a -f... option to disable the code generation effects would m= ake > > > more sense than adding another attribute kind. > >=20 > > Then maybe we'd just add a -D_GLIBC_NONNULL=3D{0,1} (?) into Glibc cdef= s.h > > instead. Anyway I'm already too frustrated about this so I'll not cont= inue > > working on nonnull within Glibc headers. If you don't like this just c= lose > > it as WONTFIX. >=20 > For those who are not following libc-alpha, glibc already disables __nonn= ull > during its build, so it should be totally fine to use __nonnull in instal= led > headers to improve diagnostics. But Zack's reason against using __nonnull is __nonnull may cause unwanted optimizations to *the user code*.=