This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


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

gcc std namespace bug


hi,
gcc forget to put a few system class and function into namespace std.
it's a serious bug, like the following simple code illustrate:

# gcc -v
Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/2.96/specs
gcc version 2.96 20000724 (experimental)
---------------------	
#include <new>
#include <exception>

int* myalloc() throw (std::bad_alloc)
{
  return new int[1000000000L];
}

int main()
{
  int* a = myalloc();
  return 0;
}
---------------------
give the following error:
---------------------
# gcc -fhonor-std test.cpp
/tmp/ccnxRogi.o: In function `myalloc(void)':
/home/lfarkas/tmp/test.cpp:7: undefined reference to `std::bad_alloc type_info
function'
/home/lfarkas/tmp/test.cpp:7: undefined reference to `std::terminate(void)'
collect2: ld returned 1 exit status
---------------------
this is on a redhat linux 6.2 with gcc from rh 7.0 beta.
actually the problem just with files under
/usr/lib/gcc-lib/i386-redhat-linux/2.96/include/
since just these files effect the compilation of c++ code which use namespace
(since these are the only few files with are compiler native c++ header
files).
yours.

 -- Levente
 "The only thing worse than not knowing the truth is
  ruining the bliss of ignorance."

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