This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: shadowed rel_ops operators


On Wed, Jan 24, 2001 at 08:47:40AM +1100, Richard Andrews wrote:
> > 
> > Any suggestions for the text of the #warning?
> 
> "warning : rel_ops may interfere with parts of standard library. See
> $(documentation) for details."

A patch is below.  There's no #warning yet, just a comment.  We still have
to include stl_relops.h in std_utility.h because including <utility> must
give you access to these operators (thus saith 14882).  And since there
are many other reasons to include <utility>, #warning would be too much.

(Somebody today asked about the tmpnam link_warning from glibc on the
gcc list.  That's what I've been wanting: something more precise than
#warning, something that only fires off when it's actually used.  But at
compile time rather than link time.)

Comments on the patch?


> I'm sure we've only seen a small fraction of the areas rel_ops can interfere with. 
> Maybe there should be a section in a FAQ or info page somewhere dedicated to known conflicts.

I added an entry in the FAQ already.  There's no list of known conflicts,
however (patches cheerfully accepted).

Phil


Index: std_iterator.h
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/include/bits/std_iterator.h,v
retrieving revision 1.1
diff -c -3 -r1.1 std_iterator.h
*** std_iterator.h	2000/10/05 11:27:01	1.1
--- std_iterator.h	2001/01/23 22:22:50
***************
*** 28,34 ****
  #define _CPP_ITERATOR 1
  
  #include <bits/stl_config.h>
- #include <bits/stl_relops.h>
  #include <bits/std_cstddef.h>
  #include <bits/std_iosfwd.h>
  #include <bits/stl_iterator_base.h>
--- 28,33 ----
Index: std_numeric.h
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/include/bits/std_numeric.h,v
retrieving revision 1.1
diff -c -3 -r1.1 std_numeric.h
*** std_numeric.h	2000/10/05 11:27:01	1.1
--- std_numeric.h	2001/01/23 22:22:50
***************
*** 28,34 ****
  #define _CPP_NUMERIC 1
  
  #include <bits/stl_config.h>
- #include <bits/stl_relops.h>
  #include <bits/std_cstddef.h>
  #include <bits/std_iterator.h>
  #include <bits/stl_function.h>
--- 28,33 ----
Index: stl_algobase.h
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/include/bits/stl_algobase.h,v
retrieving revision 1.2
diff -c -3 -r1.2 stl_algobase.h
*** stl_algobase.h	2000/10/10 23:50:38	1.2
--- stl_algobase.h	2001/01/23 22:22:51
***************
*** 33,39 ****
  #define __SGI_STL_INTERNAL_ALGOBASE_H
  
  #include <bits/stl_config.h>
- #include <bits/stl_relops.h>
  #ifndef __SGI_STL_INTERNAL_PAIR_H
  #include <bits/stl_pair.h>
  #endif
--- 33,38 ----
Index: stl_relops.h
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/include/bits/stl_relops.h,v
retrieving revision 1.1
diff -c -3 -r1.1 stl_relops.h
*** stl_relops.h	2000/10/05 11:27:01	1.1
--- stl_relops.h	2001/01/23 22:22:51
***************
*** 28,33 ****
--- 28,39 ----
   *   You should not attempt to use it directly.
   */
  
+ /**** libstdc++-v3 note:  Inclusion of this file has been removed from
+  * all of the other STL headers for safety reasons, except std_utility.h.
+  * For more information, see the thread of about twenty messages starting
+  * with http://gcc.gnu.org/ml/libstdc++/2001-01/msg00223.html
+ */
+ 
  #ifndef _CPP_BITS_STL_RELOPS_H
  #define _CPP_BITS_STL_RELOPS_H 1
  

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]