Subject: Re: Build error in gnu sources
To: None <trevin@xmission.com>
From: Greg Earle <earle@isolar.Tujunga.CA.US>
List: current-users
Date: 04/05/1996 12:31:43
>> 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
[...]
>>/usr/users/trevin/Projects/sys/gnu/lib/libg++/libg++/src/../../libstdc++/st
>> d/new.h:31: syntax error before `{'
>> *** Error code 1
>> 
>> 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)

You meant /usr/include/g++, I assume.

Incidentally (and I doubt this is related to Trevor's problem, which is a
weird one since my latest "make build" of a week ago didn't run into it),
I have old cruft in /usr/include/g++.  It's all dated from last Nov. 24th
and appears to be includes from the old /usr/src/gnu/lib/libg++/iostream
that now have been moved to /usr/src/gnu/lib/libg++/libio:

scipio# ls -lt `locate /SFile.h`
-rw-r--r--  1 root 1909 Mar  9 04:12 /usr/src/gnu/lib/libg++/libio/SFile.h
-r--r--r--  1 bin  1568 Nov 24 05:33 /usr/include/g++/SFile.h
-rw-rw-r--  1 234  1568 Oct 13 17:06\
/usr/src/1.1/usr/src/gnu/lib/libg++/iostream/SFile.h

scipio# ls -lt `locate /procbuf.h`
-rw-r--r--  1 root 1787 Mar  9 04:12 /usr/src/gnu/lib/libg++/libio/procbuf.h
-r--r--r--  1 bin  1251 Nov 24 05:33 /usr/include/g++/procbuf.h
-rw-rw-r--  1 234  1251 Oct 13 17:06\
/usr/src/1.1/usr/src/gnu/lib/libg++/iostream/procbuf.h

scipio# ls -lt `locate /new.h`
-r--r--r--  1 bin   842 Mar 25 21:14 /usr/include/g++/std/new.h
-rw-r--r--  1 root  842 Mar  9 04:13 /usr/src/gnu/lib/libg++/libstdc++/std/new.
h
-rw-r--r--  1 root  160 Mar  9 04:13 /usr/src/gnu/lib/libg++/libstdc++/new.h
-r--r--r--  1 bin   856 Nov 24 05:33 /usr/include/g++/new.h
-rw-rw-r--  1 234   856 Oct 13 17:07\
/usr/src/1.1/usr/src/gnu/lib/libg++/libg++/new.h

Clearly old cruft from 1.1 that shouldn't still be around, but it begs the
questions: (1) Why aren't the -current versions from .../libio/ installed in
their place (in /usr/include/g++); and (b) how much of this old 1.1 cruft is
lying around waiting to bite someone who compiles things expecting to get a
newer or different version of something?

(Pondering "ls -ltRFC / | awk '$6 == "Nov" && $7 == "24" { print $NF }' | xargs
 rm -f" ... )

	- Greg