|Paul H. Hargrove
Joined: 11 Apr 2005
|Posted: Tue Apr 12, 2005 11:22 am Post subject: Conflicts between pgi6.0 sys/types.h and glibc headers
|I am using the linux86 version of pgcc-6.0-2 on a system with glibc-2.3.2-4.80.8 from RedHat. I am on a 15-day eval license and my experience so far is not encouraging me to purchase a full license.
I realize that pgcc is using a private version on sys/types.h, but that file is failing to defined the __<TYPE>_defined macros used by glibc. These are used in many places, such as the following from unistd.h:
typedef __ssize_t ssize_t;
# define __ssize_t_defined
As a result the following 3-line program
PGC-W-0114-More than one type specified (/usr/include/unistd.h: 193)
PGC-W-0143-Useless typedef declaration (no declarators present) (/usr/include/unistd.h: 193)
PGC-W-0114-More than one type specified (/usr/include/sys/mman.h: 30)
PGC-W-0143-Useless typedef declaration (no declarators present) (/usr/include/sys/mman.h: 30)
PGC-W-0114-More than one type specified (/usr/include/sys/mman.h: 38)
PGC-W-0143-Useless typedef declaration (no declarators present) (/usr/include/sys/mman.h: 38)
PGC/x86 Linux/x86 6.0-2: compilation completed with warnings
In a real application I get about 50 such lines making it hard to distinguish meaningful warnings about my code from ones about broken headers.
Joined: 30 Jun 2004
Location: The Portland Group Inc.
|Posted: Wed Apr 13, 2005 8:56 am Post subject:
Unfortunately, some of the GNU header files contains statements which mask certain portions of the header files from non-GNU compilers, example "#if defined (__GNUC__)". While we'ed rather use the system's header files, in a few instances we've had to include our own as a work around.
For you, who needs the system's types.h file, add "-I/usr/include" to the compilation line. This will override the compiler's default location and first use this directory to find the header files.
Hope this helps,