On Monday 11 March 2002 16:30, you wrote:
> Hi Tru64 managers,
(original e-mail at the end)
I've got one reply from Dave Love (thanks!) who suggested to
use the headers of gcc 3.00. I've have not tried this solution
yet.
Further investigation of the problem uncovered that g++
defines __STDC_VERSION__ == 199409 while cxx does not.
In /usr/include/standards.h the def of the macro __R is in 4.0
(and I guess same in 5.1):
#if defined(_XOPEN_SOURCE_EXTENDED) && !defined(_LIBC_POLLUTION_H_) && !defined(__DECC)
#define __R(__dname__) _E##__dname__
#else
#define __R(__dname__) __dname__
#endif /* _XOPEN_SOURCE_EXTENDED && !_LIBC_POLLUTION_H_ && !__DECC */
but in in 5.1a it looks like
#if (defined(_XOPEN_SOURCE_EXTENDED) || (__STDC_VERSION__ == 199409))&& !defined(_LIBC_POLLUTION_H_) && !defined(__DECC)
...
Therefore g++ in 5.1a now uses:
#define __R(__dname__) _E##__dname__
instead of
#define __R(__dname__) __dname__
In the fix'ed header unistd.h the if test is false
#if defined(_XOPEN_SOURCE_EXTENDED) && !defined(_LIBC_POLLUTION_H_)
#ifdef __DECC
#pragma extern_prefix "_E"
#else
#define pipe _Epipe
#endif
#endif /* _XOPEN_SOURCE_EXTENDED && !_LIBC_POLLUTION_H_ */
extern int __R(pipe) __((int []));
So _Epipe is declared and therefore compiler complains about
implizit decalration of int pipe(). Same for other sys calls.
If still not sure who's wrong. g++ defining __STDC_VERSION__
(this about is C++, isn't it) or the new tru64 headers or
gcc fix header stuff.
My current solution is to CXXFLAGS += -D__STDC_VERSION__=42
(hi hitchhikers) and now g++ compilies the software on 5.1a as before
on 4.0* and 5.*.
Achim
> after 5.1 -> 5.1a upgrade g++ 2.95.{2,3} has problems with
> defs of system calls like pipe, signal, etc (cxx has no problems).
> E.g.:
>
> o22(0) ~/tmp > cat x.cpp
> #include <unistd.h>
> int main ( int argc, char* argv[]) {
> int i,fd[2];
> i= pipe(fd);
> }
> o22(0) ~/tmp > cxx x.cpp
> o22(0) ~/tmp > g++ x.cpp
> x.cpp: In function `int main(int, char **)':
> x.cpp:4: implicit declaration of function `int pipe(...)'
>
> I've build gcc 2.95.3 from source again but still the same.
> Any idea how to fix gcc fixheaders?
>
> Ah, and no, I can't update to gcc 3.0* until the (external)
> sources are 'name space' clean ;)
>
> Thx,
> Achim
--
To me vi is Zen. To use vi is to practice zen. Every command is
a koan. Profound to the user, unintelligible to the uninitiated.
You discover truth everytime you use it.
-- reddy_at_lion.austin.ibm.com
Received on Thu Mar 14 2002 - 14:14:42 NZDT