tru64-unix-managers (formerly alpha-osf-managers) (1994-2012)
 help / color / mirror / Atom feed
* [SUMMARY] fix'ed headers files of gcc 2.95.{2,3} on Tru64 5.1a 'broken'
@ 2002-03-14 14:14 Achim Bohnet
  0 siblings, 0 replies; only message in thread
From: Achim Bohnet @ 2002-03-14 14:14 UTC (permalink / raw)
  To: tru64-unix-managers

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@lion.austin.ibm.com

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2002-03-14 14:14 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-03-14 14:14 [SUMMARY] fix'ed headers files of gcc 2.95.{2,3} on Tru64 5.1a 'broken' Achim Bohnet

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox