[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

3582.0. "Redefinition of operator new??" by KERNEL::PULLEY (Come! while living waters flow) Wed May 21 1997 14:08

    Hi,
    
    My customer, Digital UNIX V4.0 ?, C++ v5.5, tryed down loading the STL
    from the HP public domain, (Buttler source).
    He got an error on line 26 of defalloc.h something like:-
    redefinition of operator new ....
    
    Had to comment a line in defalloc.h that said something like:-
    inline void *p operator new ...
    There's a line says the same in new.h
    The GNU does not complain but has exactly the same source.
    Is that expected?
    
    Thanks,
    Steve.
T.RTitleUserPersonal
Name
DateLines
3582.1yes, this is an expected errorDECC::J_WARDWed May 21 1997 14:4622
Yes it is illegal to redefine a function in C++.
I don't know why GNU doesn't complain, perhaps their
definition is in some other header file that is not
being pulled in by the header files that are included
by defalloc.h. Or perhaps their definition is in an
out-of-line function in their library. In any case
a library vendor should not be trying to redefine
it and the SGI version of defalloc.h (see below) has
removed this. Incidentally, the name defalloc.h is
wrong, it should be <memory> according to the C++
standard. The DEC C++ STL headers all have the correct names.

Why are they trying to use (the very old and out-of-date)
HP STL implementation when DEC C++ distributes a more current
version with the compiler? Why don't they at least
switch to the SGI implementation (The inventor of the
STL changed jobs from HP to SGI a few years back and
his group now distributes the STL). You can get
more info on where to download the SGI version if
you send email to stl@sgi.com. Unfortunately they
haven't updated the header files names, though ):