Mail Archives: djgpp/1999/08/20/03:24:46
Hi there,
A strange problem with g++ exceptions here.. Take the following simplified
example:
------------------------------
#include <iostream>
class testException
{
public:
};
void main()
{
cout << "test " << endl;
try {
throw testException();
} catch (testException &e) {
cout << "caught testException.." << endl;
} catch (...) {
cout << "or anything.." << endl;
}
}
------------------------------
This works fine on gcc 2.8.1, but aborts on 2.95. (I had similar troubles with
egcs 1.1.x, so never made the switch to that compiler).
Compiling with 'gpp -v test.cc -o test.exe':
Reading specs from c:/djgpp/lib/gcc-lib/djgpp/2.95/specs
gcc version 2.95 19990728 (release)
c:/djgpp/lib/gcc-lib/djgpp/2.95/cpp.exe -lang-c++ -v -D__GNUC__=2 -
D__GNUG__=2 -D__GNUC_MINOR__=95 -D__cplusplus -Dunix -Di386 -
DGO32 -DDJGPP=2 -DMSDOS -D__unix__ -D__i386__ -D__GO32__ -
D__DJGPP__=2 -D__MSDOS__ -D__unix -D__i386 -D__GO32 -
D__DJGPP=2 -D__MSDOS -Asystem(unix) -Asystem(msdos) -Acpu(i386) -
Amachine(i386) -D__EXCEPTIONS -Acpu(i386) -Amachine(i386) -Di386 -
D__i386 -D__i386__ -Di586 -Dpentium -D__i586 -D__i586__ -D__pentium -
D__pentium__ -imacros c:/djgpp/bin/../include/sys/version.h -remap test.cc
c:/tmp\cczteee8.ii
GNU CPP version 2.95 19990728 (release) (80386, BSD syntax)
#include "..." search starts here:
#include <...> search starts here:
c:/djgpp/lang/cxx
c:/djgpp/lib/gcc-lib/djgpp/2.95/include
c:/djgpp/include
End of search list.
The following default directories have been omitted from the search path:
$DJDIR/lib/gcc-lib/djgpp/2.95/../../../../djgpp/include
End of omitted list.
c:/djgpp/lib/gcc-lib/djgpp/2.95/cc1plus.exe c:/tmp\cczteee8.ii -quiet -
dumpbase test.cc -version -o c:/tmp\ccnNljsa.s
GNU C++ version 2.95 19990728 (release) (djgpp) compiled by GNU C
version 2.95 19990728 (release).
c:/djgpp/bin/as.exe -o c:/tmp\ccv7jERR.o c:/tmp\ccnNljsa.s
c:/djgpp/lib/gcc-lib/djgpp/2.95/collect2.exe -o test.exe c:/djgpp/lib/crt0.o -
Lc:/djgpp/lib/gcc-lib/djgpp/2.95 -Lc:/djgpp/bin -Lc:/djgpp/lib
c:/tmp\ccv7jERR.o -lstdcxx -lm -lgcc -lc -lgcc -Tdjgpp.djl
c:/djgpp/bin/stubify.exe -v test.exe
stubify for djgpp V2.X executables, Copyright (C) 1995 DJ Delorie
stubify: test.exe -> test.000 -> test.exe
Program output:
--------
test
Abort!
--------
I upgraded from gcc 2.8.1 by installing bnu291, gcc295b and gpp295b in
that order, and looked for old files according to readme.djgpp (they were
gone already).
It seems the throw is never caught, but surely exception handling can't be
*that* broken? I wonder what I'm doing wrong this time :)
Thanks!
Rob Kramer
robk AT cyberway DOT com DOT sg
- Raw text -