public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "eggert at cs dot ucla.edu" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug c/114869] New: GCC says nullptr_t is a C built in but it should be in <stddef.h> Date: Fri, 26 Apr 2024 20:14:00 +0000 [thread overview] Message-ID: <bug-114869-4@http.gcc.gnu.org/bugzilla/> (raw) https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114869 Bug ID: 114869 Summary: GCC says nullptr_t is a C built in but it should be in <stddef.h> Product: gcc Version: 14.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: eggert at cs dot ucla.edu Target Milestone: --- This is gcc (GCC) 14.0.1 20240411 (Red Hat 14.0.1-0) on x86-64. Compile the following one-line program with 'gcc -S t.c': nullptr_t x; GCC fails to issue a diagnostic that is required because nullptr_t is used without being defined. Conversely, compile the following program with 'gcc -std=gnu23 -Wshadow -Wsystem-headers -S t.c': #include <stddef.h> nullptr_t x; GCC issues the following incorrect diagnostic: In file included from t.c:1: /usr/lib/gcc/x86_64-redhat-linux/14/include/stddef.h:450:31: warning: declaration of ‘nullptr_t’ shadows a global declaration [-Wshadow] 450 | typedef __typeof__(nullptr) nullptr_t; | ^~~~~~~~~ cc1: note: shadowed declaration is here It seems that gcc defines nullptr_t as a built in identifier, which is incorrect; nullptr_t should be defined by <stddef.h> just like ptrdiff_t is.
next reply other threads:[~2024-04-26 20:14 UTC|newest] Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top 2024-04-26 20:14 eggert at cs dot ucla.edu [this message] 2024-04-29 21:22 ` [Bug c/114869] " jsm28 at gcc dot gnu.org 2024-04-29 21:25 ` mpolacek at gcc dot gnu.org
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-114869-4@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).