public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/110092] New: Missing warning that internal header is used
@ 2023-06-02 12:41 piotrwn1 at gmail dot com
  2023-06-02 12:57 ` [Bug c++/110092] " redi at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: piotrwn1 at gmail dot com @ 2023-06-02 12:41 UTC (permalink / raw)
  To: gcc-bugs

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"

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2023-06-05  9:13 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-02 12:41 [Bug c++/110092] New: Missing warning that internal header is used piotrwn1 at gmail dot com
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

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).