I tried to factor some commonly used catch blocks into an include file to be referenced from 50 or so locations in my system, but the compiler prints an error message which indicates that it is not seeing what's in the #include file.
[gpvu] martha 62: /usr/local/bin/g++ -v Reading specs from /usr/local/lib/gcc-lib/sparc-sun-solaris2.8/3.2/specs Configured with: ../configure --with-as=/usr/ccs/bin/as --with- ld=/usr/ccs/bin/ld --disable-nls Thread model: posix gcc version 3.2 /usr/local/bin/g++ -fPIC -shared -g -MMD -c -Wno-deprecated -Wunknown-pragmas - Wpadded -DBUILD3 -DCGAI30 -DSunOS -Dreally_cplusplus -I/nfs_server1/MK2 - I/nfs_server1/MK2/COMM -I/nfs_server1/MK2/IS/cc/src - I/nfs_server1/MK2/COMM/msg -I/nfs_server1/MK2/COMM/basic - I/nfs_server1/MK2/COMM/shell/src -I/nfs_server1/MK2/COMM/frmwks/Log_Manager - I/nfs_server1/MK2/COMM/frmwks/Special_DX_Manager -I/nfs_server1/MK2/IS/mts/src - I/nfs_server1/MK2/IS/mts/src/incl -I/nfs_server1/MK2/COMM/frmwks/System - I/nfs_server0/tornado/wind2/target/proj/SSDS - o ./obj_sun/IBuilder_t.o -c /nfs_server1/MK2/COMM/frmwks/System/IBuilder_t.cpp <internal>:0: warning: padding struct size to alignment boundary /nfs_server1/MK2/COMM/frmwks/System/IBuilder_t.cpp: In function `void junk()': /nfs_server1/MK2/COMM/frmwks/System/IBuilder_t.cpp:0: `...' handler must be the last handler for its try block The .ii file (and the source files so you can see what is missing) [gpvu] martha 102: more IBuilder_t.ii # 1 "/nfs_server1/MK2/COMM/frmwks/System/IBuilder_t.cpp" # 1 "<built-in>" # 1 "<command line>" # 1 "/nfs_server1/MK2/COMM/frmwks/System/IBuilder_t.cpp" # 14 "/nfs_server1/MK2/COMM/frmwks/System/IBuilder_t.cpp" void junk() { try { int j = 0; } } [gpvu] martha 103: more /nfs_server1/MK2/COMM/frmwks/System/IBuilder_t.cpp //## begin module%1.3%.codegen_version preserve=yes // Read the documentation to learn more about C++ code generator // versioning. //## end module%1.3%.codegen_version //## Module: IBuilder_t%38D8263703A8; Pseudo Package body //## Source file: V:\MK2\COMM\frmwks\System\IBuilder_t.cpp //## begin module%38D8263703A8.includes preserve=yes //## end module%38D8263703A8.includes // IBuilder_t //#include <COMM/frmwks/System/IBuilder_t.h> void junk() { try { int j = 0; } #include<COMM/frmwks/System/SafetyNetCatchAndThrow.inl> } //## begin module%38D8263703A8.additionalDeclarations preserve=yes //## end module%38D8263703A8.additionalDeclarations // Parameterized Class IBuilder_t // Additional Declarations //## begin IBuilder_t%38D8263703A8.declarations preserve=yes //## end IBuilder_t%38D8263703A8.declarations //## begin module%38D8263703A8.epilog preserve=yes //## end module%38D8263703A8.epilog [gpvu] martha 104: more /nfs_server1/MK2/COMM/frmwks/System/SafetyNetCatchAndThrow.inl catch (...) { int j = 5; } -- Summary: Catch statements in #include file not pulled in by preprocessor Product: gcc Version: 3.2 Status: UNCONFIRMED Severity: normal Priority: P2 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: garyepellecchia at yahoo dot com CC: gcc-bugs at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18917