[cfe-dev] cannot use 'throw' with exceptions disabled

Hao Jiang hjian001 at fiu.edu
Thu May 19 13:27:27 PDT 2011


Hello everyone,
I tried to make a clang plugin to parse the source code. But when I parse
the file clang generate errors as following:
/opt/local/bin/mpicxx -E -C -I. -I../.. -g -O2 -o _tmp_0.cc chevt.cc
/Users/llvm/Release+Asserts/bin/clang -cc1 -load
../../xlate/clangit/libannotate.so -plugin minissf-annotate -I. -I../.. -g
-O2 -fexceptions _tmp_0.cc -o _tmp_1.x
In file included from chevt.cc:4:
In file included from ../../ssf.h:15:
In file included from ../../ssfapi/ssf_common.h:28:
In file included from /opt/local/include/mpich2/mpi.h:1197:
/opt/local/include/mpich2/mpicxx.h:184:91: error: cannot use 'throw' with
exceptions disabled
        {int err; err = MPI_Type_commit( (MPI_Datatype *) &the_real_datatype
) ; if (err) throw Exception(err);};
                                                                                         
^
/opt/local/include/mpich2/mpicxx.h:188:89: error: cannot use 'throw' with
exceptions disabled
        {int err; err = MPI_Type_free( (MPI_Datatype *) &the_real_datatype )
; if (err) throw Exception(err);};
                                                                                       
^
/opt/local/include/mpich2/mpicxx.h:193:140: error: cannot use 'throw' with
exceptions disabled
        {int err; err = MPI_Type_indexed( v1, (int *)v2, (int *)v3,
(MPI_Datatype) the_real_datatype, &(v5.the_real_datatype) ) ; if (err) throw
Exception(err);};
                                                                                                                                          
^
/opt/local/include/mpich2/mpicxx.h:199:121: error: cannot use 'throw' with
exceptions disabled
        {int err; err = MPI_Type_contiguous( v1, (MPI_Datatype)
the_real_datatype, &(v3.the_real_datatype) ) ; if (err) throw
Exception(err);};
                                                                                                                       
^
/opt/local/include/mpich2/mpicxx.h:205:125: error: cannot use 'throw' with
exceptions disabled
        {int err; err = MPI_Type_vector( v1, v2, v3, (MPI_Datatype)
the_real_datatype, &(v5.the_real_datatype) ) ; if (err) throw
Exception(err);};
                                                                                                                           
^
I tried both enable and disable exceptions(with -fexceptions) but the
results were the same. Anyone know how to fix this. Any suggestion is
appreciated, thanks. 
Hao Jiang

--
View this message in context: http://clang-developers.42468.n3.nabble.com/cannot-use-throw-with-exceptions-disabled-tp2963038p2963038.html
Sent from the Clang Developers mailing list archive at Nabble.com.



More information about the cfe-dev mailing list