public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/24720]  New: poorly named include guard in stl_tree.h
@ 2005-11-07 21:48 carmelo dot piccione at gmail dot com
  2005-11-07 21:51 ` [Bug libstdc++/24720] " pinskia at gcc dot gnu dot org
  2005-11-07 21:54 ` pcarlini at suse dot de
  0 siblings, 2 replies; 3+ messages in thread
From: carmelo dot piccione at gmail dot com @ 2005-11-07 21:48 UTC (permalink / raw)
  To: gcc-bugs

Due to the global nature of macros, the include guard at the top of stl_tree.h:

#ifndef _TREE_H 
...

should be renamed to something more specific such as _STL_TREE_H. _TREE_H
shouldn't really be defined by anyone, especially the STL library. I noticed
this header from someone else who wrote code with a C include guard of the same
name which caused a compiler error when using #include <map>. This convention
of being as specific as possible for any include guard macro should be
pervasive through the entire C++ header collection.


-- 
           Summary: poorly named include guard in stl_tree.h
           Product: gcc
           Version: 3.4.4
            Status: UNCONFIRMED
          Severity: minor
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: carmelo dot piccione at gmail dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24720


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

* [Bug libstdc++/24720] poorly named include guard in stl_tree.h
  2005-11-07 21:48 [Bug c++/24720] New: poorly named include guard in stl_tree.h carmelo dot piccione at gmail dot com
@ 2005-11-07 21:51 ` pinskia at gcc dot gnu dot org
  2005-11-07 21:54 ` pcarlini at suse dot de
  1 sibling, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-11-07 21:51 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from pinskia at gcc dot gnu dot org  2005-11-07 21:51 -------
Note _TREE_H is reserved by the standard for implementations so this is a
correct use really.  Anyone using _TREE_H in their headers are asking for
troubles as they are using a reserved identifier.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|c++                         |libstdc++


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24720


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

* [Bug libstdc++/24720] poorly named include guard in stl_tree.h
  2005-11-07 21:48 [Bug c++/24720] New: poorly named include guard in stl_tree.h carmelo dot piccione at gmail dot com
  2005-11-07 21:51 ` [Bug libstdc++/24720] " pinskia at gcc dot gnu dot org
@ 2005-11-07 21:54 ` pcarlini at suse dot de
  1 sibling, 0 replies; 3+ messages in thread
From: pcarlini at suse dot de @ 2005-11-07 21:54 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from pcarlini at suse dot de  2005-11-07 21:54 -------
(In reply to comment #1)
> Note _TREE_H is reserved by the standard for implementations so this is a
> correct use really.  Anyone using _TREE_H in their headers are asking for
> troubles as they are using a reserved identifier.

Indeed. Please read closely 17.4.3.1.2.


-- 

pcarlini at suse dot de changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |INVALID


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24720


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

end of thread, other threads:[~2005-11-07 21:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-11-07 21:48 [Bug c++/24720] New: poorly named include guard in stl_tree.h carmelo dot piccione at gmail dot com
2005-11-07 21:51 ` [Bug libstdc++/24720] " pinskia at gcc dot gnu dot org
2005-11-07 21:54 ` pcarlini at suse dot de

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