[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference turris::c_plus_plus

Title:C++
Notice:Read 1.* and use keywords (e.g. SHOW KEY/FULL KIT_CXX_VAX_VMS)
Moderator:DECCXX::AMARTIN
Created:Fri Nov 06 1987
Last Modified:Thu Jun 05 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:3604
Total number of notes:18242

3567.0. "Conflict between <exception.h> and <cxx_exception.h>/ed" by BACHUS::SABLON () Tue May 13 1997 09:09

    C++ T5.6-6
    Digital UNIX 4.0-B
    
    	While recompiling C++ programs, the below error was generated. The
    	program here after does reproduce it. It appears to be a conflict
    	in the declarations of these functions between exception and
    	cxx_exception.h
    
    	/Michele.
    
    exc.cxx:
    --------
    #include <exception>
    #include <cxx_exception.h>
    
    int i;
    
    The error:
    ----------
    cxx: Error: /usr/include/cxx/cxx_exception.h, line 30: In this declaration,
    the linkage specification of "terminate" differs from that of a previous 
    declaration of "terminate".
    void terminate (void);
    -----^
    
    cxx: Error: /usr/include/cxx/cxx_exception.h, line 31: In this
    declaration, the linkage specification of "set_terminate" differs
    from that of a previous declaration of "set_terminate".
    PFV set_terminate (PFV terminator);
    ----^
    cxx: Error: /usr/include/cxx/cxx_exception.h, line 32: In this
    declaration, the linkage specification of "unexpected" differs fr
    om that of a previous declaration of "unexpected".
    void unexpected (void);
    -----^
    cxx: Error: /usr/include/cxx/cxx_exception.h, line 33: In this
    declaration, the linkage specification of "set_unexpected" differ
    s from that of a previous declaration of "set_unexpected".
    PFV set_unexpected (PFV surprise);
    ----^
    
    
T.RTitleUserPersonal
Name
DateLines
3567.1DECCXL::OUELLETTEmudseason into blackfly seasonTue May 13 1997 18:1423
Hmmm.  I can't reproduce this.  Perhaps the problem is your headers.
With V5.5...

cosf> cat /etc/motd | head -1
Digital UNIX V4.0 (Rev. 386); Thu Aug 29 12:01:40 EDT 1996
cosf> cat cxx3567.cxx
#include <exception>
#include <cxx_exception.h>
int i;
cosf> !cxx
cosf> cxx -V -c cxx3567.cxx
cxx  (cxx)
DEC C++ V5.5-004 on Digital UNIX (Alpha)
cosf> cxx -c cxx3567.cxx
cosf> $RTS_COMPILER -c cxx3567.cxx -V
/usr/proj/decc2/v56_cxx/cxxalphaosf/bl33/exe/deccxx_driver  (cxx)
DEC CXX T5.6-022 on Digital UNIX (Alpha)
cosf> $RTS_COMPILER -c cxx3567.cxx

I'd recomend checking your header files against those on the distribution
kit for differences.

Roland.
3567.2I'm working on thisTLE::WHITMANTue May 13 1997 18:302
    I can reproduce this with V5.6 Ft2.  It looks like a library
    problem but I'm still investigating what the correct solution is.
3567.3TLE::WHITMANThu May 15 1997 19:2136
hi,

Firstly, I apologize for the delay getting back to you.  The
compilation errors you are getting in a program that includes
<exception> and <cxx_exception.h> are due to terminate(),
set_terminate(), unexpected(), and set_unexpected() being declared
with "C" linkage in <cxx_exception.h> and without "C" linkage in
<exception>.  As it turns out, the library shipped with V5.6 only
includes entry points for terminate(), set_terminate(), unexpected(),
and set_unexpected() with "C" linkage.  Therefore the work-around for
this problem is to edit /usr/include/cxx/exception as follows:

#if defined(__DECCXX)
extern "C" {
#endif

typedef void (*terminate_handler) ();
extern terminate_handler set_terminate(terminate_handler f) _RWSTD_THROW_SPEC_NU
LL;
extern void terminate( );

typedef void (*unexpected_handler) ();
extern unexpected_handler set_unexpected( unexpected_handler f)  _RWSTD_THROW_SP
EC_NULL;
extern void unexpected();

#if defined(__DECCXX)
}
#endif

For the final release of DEC C++ V5.6 we will fix <exception> so that
the functions above are declared with "C" linkage.  We will
investigate providing a more "C++ Standard" solution for these
routines in the library and headers for a future release of DEC C++.

Thanks for reporting this problem to us.