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 ___defined macros used by glibc. These are used in many places, such as the following from unistd.h:

#ifndef __ssize_t_defined
typedef __ssize_t ssize_t;

define __ssize_t_defined

#endif

As a result the following 3-line program

#include <sys/types.h>
#include <unistd.h>
#include <sys/mman.h>

results in

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.

-Paul

Hi Paul,


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,
Mat