This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Tail recursion vs exceptions vs C++
- From: Iain McClatchie <iain at truecircuits dot com>
- To: gcc at gcc dot gnu dot org
- Date: Fri, 24 Oct 2003 13:43:18 -0700
- Subject: Tail recursion vs exceptions vs C++
- Organization: True Circuits, Inc
I cannot compile the following one-line program without
disabling exceptions. Fails for both GCC 3.2.2 and 3.2.1.
int main() { main(); }
Use the command line:
gcc tail.cc
Note that if the C compiler is used rather than the C++
compiler, GCC succeeds. egcs-2.91.66 (that's the old Red
Hat release) works, if that matters.
queue21 (try) [6] % gcc tail.cc
/tmp/ccgYrf4b.o(.eh_frame+0x11): undefined reference to `__gxx_personality_v0'
collect2: ld returned 1 exit status
queue21 (try) [7] % gcc --version
gcc (GCC) 3.2.2 20030222 (Red Hat Linux 3.2.2-5)
...
% /usr/local/gcc3.2.1/bin/gcc tail.cc
/tmp/ccwq3zf9.o(.eh_frame+0x11): undefined reference to `__gxx_personality_v0'
collect2: ld returned 1 exit status
% /usr/local/gcc3.2.1/bin/gcc --version
gcc (GCC) 3.2.1
...
% /usr/local/gcc3.2.1/bin/gcc -fno-exceptions tail.cc
% gcc -fno-exceptions tail.cc
%
-Iain McClatchie iain-5@truecircuits.com
650-691-7604 voice
True Circuits, Inc. 650-691-7606 FAX
650-703-2095 cell