List Info

Thread: Re: Exceptions not caught in gcc-4.3.0 program




Re: Exceptions not caught in gcc-4.3.0 program
country flaguser name
Italy
2008-04-09 04:13:52
MLOmlinux 11 $ cat exc.C
#include <iostream>
#include <string>
using namespace std;
void fun();

int main() {
  try {
     throw string("Hi there!");
  }
  catch (string s) {
    cout << "Catched exception ""
<< s << ""n";
  }
}
MLOmlinux 12 $ g++ -ansi -Wall -o exc exc.C
MLOmlinux 13 $ ./exc
Catched exception "Hi there!"
MLOmlinux 14 $ g++ -v
Using built-in specs.
Target: i386-redhat-linux
Configured with: ../configure --prefix=/usr
--mandir=/usr/share/man --infodir=/usr/share/info
--enable-shared --enable-threads=posix
--enable-checking=release --with-system-zlib
--enable-__cxa_atexit --disable-libunwind-exceptions
--enable-languages=c,c++,objc,obj-c++,java,fortran,ada
--enable-java-awt=gtk --disable-dssi --enable-plugin
--with-java-home=/usr/lib/jvm/java-1.5.0-gcj-1.5.0.0/jre
--enable-libgcj-multifile --enable-java-maintainer-mode
--with-ecj-jar=/usr/share/java/eclipse-ecj.jar
--with-cpu=generic --host=i386-redhat-linux
Thread model: posix
gcc version 4.1.2 20070925 (Red Hat 4.1.2-27)
MLOmlinux 15 $ 

-- 
Maurizio Loreti                         http://www.pd.
infn.it/~loreti/mlo.html
Dept. of Physics, Univ. of Padova, Italy      ROT13:
Znhevmvb.Ybergvtznvy.pbz
_______________________________________________
help-gplusplus mailing list
help-gplusplusgnu.org

http://lists.gnu.org/mailman/listinfo/help-gplusplus

Re: Exceptions not caught in gcc-4.3.0 program
country flaguser name
United States
2008-04-09 05:49:25
Thanks!
I know that exceptions must work and will probably work in
most
environments with this code.
The question is: why they don't work on my FreeBSD box.
What is the determining factor? Is there any special key I
have to
specify except for -fexceptions to turn them on?

_______________________________________________
help-gplusplus mailing list
help-gplusplusgnu.org

http://lists.gnu.org/mailman/listinfo/help-gplusplus

[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )