public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "piotrwn1 at gmail dot com" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/110092] New: Missing warning that internal header is used Date: Fri, 02 Jun 2023 12:41:41 +0000 [thread overview] Message-ID: <bug-110092-4@http.gcc.gnu.org/bugzilla/> (raw) https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110092 Bug ID: 110092 Summary: Missing warning that internal header is used Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: piotrwn1 at gmail dot com Target Milestone: --- Developers new to C++ have sometime problems with including proper std library header, instead, they sometimes include standard library internal headers - since the definition is there and some IDE shows "you have this entity here". I have tried "-Wall -Wextra -pedantic" and nothing warns me when, just for example purposes, I included `<bits/shared_ptr.h>` whilst `<memory>` should included. I see in this "internal" header (bits/shared_ptr.h) the following information: ``` 44 /** @file 45 * This is an internal header file, included by other library headers. 46 * Do not attempt to use it directly. @headername{memory} 47 */ ``` So, probably it is doable to add warning like: "bist/shared_ptr.h is an internal header file, included by other library headers. Do not attempt to use it directly. Use <memory> instead"
next reply other threads:[~2023-06-02 12:41 UTC|newest] Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top 2023-06-02 12:41 piotrwn1 at gmail dot com [this message] 2023-06-02 12:57 ` [Bug c++/110092] " redi at gcc dot gnu.org 2023-06-02 14:14 ` redi at gcc dot gnu.org 2023-06-02 14:45 ` piotrwn1 at gmail dot com 2023-06-02 22:34 ` pinskia at gcc dot gnu.org 2023-06-05 9:13 ` piotrwn1 at gmail dot com
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-110092-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).