Subject: Build error in gnu sources
To: None <current-users@NetBSD.ORG>
From: Trevin Beattie <trevin@xmission.com>
List: current-users
Date: 04/05/1996 07:48:59
>Date: Wed, 27 Mar 1996 18:53:38 -0700
>To: current-users@NetBSD.ORG
>From: Trevin Beattie <trevin@xmission.com>
>Subject: Build error in gnu sources
>
>I've tried both with the March 16 sources and now the March 23 sources, and
both have the exact same error in src/gnu/lib/libg++:
>
>g++ -O -I/usr/users/trevin/Projects/sys/gnu/lib/libg++/libg++/src
-I/usr/users/trevin/Projects/sys/gnu/lib/libg++/libg++/src/../../libio
-nostdinc++
-I/usr/users/trevin/Projects/sys/gnu/lib/libg++/libg++/src/../../include
-I/usr/users/trevin/Projects/sys/gnu/lib/libg++/libg++/src/../../libio
-I/usr/users/trevin/Projects/sys/gnu/lib/libg++/libg++/src/../../libstdc++
-c AllocRing.cc
>In file included from
/usr/users/trevin/Projects/sys/gnu/lib/libg++/libg++/src/../../libstdc++/new
.h:6, from AllocRing.cc:24:
>/usr/users/trevin/Projects/sys/gnu/lib/libg++/libg++/src/../../libstdc++/st
d/new.h:25: declaration of `__nw' as array of functions
>/usr/users/trevin/Projects/sys/gnu/lib/libg++/libg++/src/../../libstdc++/st
d/new.h:25: `__nw' redeclared as different kind of symbol
>/usr/users/trevin/Projects/sys/gnu/lib/libg++/libg++/src/../../libstdc++/st
d/new.h:24: previous declaration of `void * operator new (unsigned int)'
>/usr/users/trevin/Projects/sys/gnu/lib/libg++/libg++/src/../../libstdc++/st
d/new.h:27: declaration of `__dl' as array of functions
>/usr/users/trevin/Projects/sys/gnu/lib/libg++/libg++/src/../../libstdc++/st
d/new.h:27: `__dl' redeclared as different kind of symbol
>/usr/users/trevin/Projects/sys/gnu/lib/libg++/libg++/src/../../libstdc++/st
d/new.h:26: previous declaration of `void  operator delete (void *)'
>/usr/users/trevin/Projects/sys/gnu/lib/libg++/libg++/src/../../libstdc++/st
d/new.h:31: syntax error before `{'
>*** Error code 1
>
>Stop.
>
>
>Aside from trying to find a fix, I'd like to know why operator new and
operator delete are being redefined in new.h?  The code causing the error is:
>
>// replaceable signatures
>void *operator new (size_t);
>void *operator new[] (size_t);
>void operator delete (void *);
>void operator delete[] (void *);
>
>

Just as a follow-up: I've ran new.h through the compiler by itself (which,
by the way, is completely different from the new.h that was in /usr/include)
and still get the same error, so the problem is not dependent on another file.

Also, I've been looking through my old "C++ Primer" book on overloading
operators, and I can find documentation on overloading new and on
overloading [], but there doesn't seem to be any case that combines these
two operators.  Is there any C++ gurus out there who can explain what
"operator new[]" is supposed to be?
-----------------------
Trevin Beattie          "Do not meddle in the affairs of wizards,
trevin@xmission.com     for you are crunchy and good with ketchup."
      {:->                                     --unknown