The pdftk package fails to compile under gcc 4.3.1 from the gcc 4.3 branch due the error... /sw/lib/gcc4.3/bin/g++ pdftk.cc -I../java_libs -O3 -DPATH_DELIM=0x2f -DASK_ABOUT_WARNINGS=false -fdollars-in-identifiers -DPDFTK_VER=\"1.41\" -c /sw/lib/gcc4.3/lib/gcc/i686-apple-darwin9/4.3.1/../../../../include/c++/4.3.1/bits/ostream_insert.h: In function 'std::basic_ostream<_CharT, _Traits>& std::__ostream_insert(std::basic_ostream<_CharT, _Traits>&, const _CharT*, std::streamsize) [with _CharT = char, _Traits = std::char_traits<char>]': /sw/lib/gcc4.3/lib/gcc/i686-apple-darwin9/4.3.1/../../../../include/c++/4.3.1/ostream:517: instantiated from 'std::basic_ostream<char, _Traits>& std::operator<<(std::basic_ostream<char, _Traits>&, const char*) [with _Traits = std::char_traits<char>]' pdftk.cc:114: instantiated from here /sw/lib/gcc4.3/lib/gcc/i686-apple-darwin9/4.3.1/../../../../include/c++/4.3.1/bits/ostream_insert.h:107: error: mixing C++ and Java catches in a single translation unit This error occurs for any cerr or cout in pdftk.cc.
This regression doesn't exist in gcc 4.2.3 on i686-apple-darwin9.
I don't think this is a GCC bug at all. libstdc++ can use exceptions freely really since it is C++ code. Since there is no way to combine C++ and Java exceptions in one TU, we reject the code. Now there is exception usage in ostream, yes this is new for 4.3.0 but does not mean it is a bug in GCC.
Created attachment 15372 [details] compressed preprocessed source file for pdftk.cc File generated with... /sw/lib/gcc4.3/bin/g++ pdftk.cc -I../java_libs -O3 -E -o pdftk.i -DPATH_DELIM=0x2f -DASK_ABOUT_WARNINGS=false -fdollars-in-identifiers -DPDFTK_VER=\"1.41\" -c
Basically it is wrong that pdftk is using C++ I/O here really but instead java I/O. Anyways this is the correct error.
So it is meaningless now to attempt to set #pragma GCC java_exceptions in c++ code?
(In reply to comment #5) > So it is meaningless now to attempt to set > > #pragma GCC java_exceptions > > in c++ code? This is C++ code but it is CNI code also so setting that is ok. -- Pinski