Broken include/c_std/bits/std_cerrno.h

Nathan Myers ncm@nospam.cantrip.org
Mon Mar 5 22:58:00 GMT 2001


I tried building a program with libstdc++-v3 in CVS gcc-3.1 on Solaris 7,
and got an error in errno.h.  It turns out...

In include/c_std/bits/, the file std_cerrno.h is just wrong.
In particular, ISO 14882 _requires_ that in C++ errno be a macro, 
not a namespaced object.  As it happens, the contents of that file 
do fail if errno does happen to be a macro.

I have attached a patch, but I'm not sure the file shouldn't just
be deleted outright.  The c_std stuff, if I understand correctly,
isn't intended to be right anyway, it just shouldn't make old 
programs stop compiling.  I think deleting the file would accomplish
that.

Nathan Myers
ncm at cantrip dot org

------------
*** std_cerrno.h.orig	Tue Mar  6 06:46:21 2001
--- std_cerrno.h	Tue Mar  6 06:49:02 2001
***************
*** 39,51 ****
  #pragma GCC system_header
  #include <errno.h>
  
! namespace std 
! {
!   extern "C" int errno;
! }
! 
  #endif
  
! 
! 
! 
--- 39,46 ----
  #pragma GCC system_header
  #include <errno.h>
  
! #ifndef errno
! # define errno errno
  #endif
  
! #endif



More information about the Libstdc++ mailing list