PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

CUDA-x86.

Conflicts between pgi6.0 sys/types.h and glibc headers

 
Post new topic   Reply to topic    PGI User Forum Forum Index -> Programming and Compiling
View previous topic :: View next topic  
Author Message
Paul H. Hargrove



Joined: 11 Apr 2005
Posts: 4

PostPosted: Tue Apr 12, 2005 11:22 am    Post subject: Conflicts between pgi6.0 sys/types.h and glibc headers Reply with quote

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:

#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
Back to top
View user's profile
mkcolg



Joined: 30 Jun 2004
Posts: 5815
Location: The Portland Group Inc.

PostPosted: Wed Apr 13, 2005 8:56 am    Post subject: Reply with quote

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
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    PGI User Forum Forum Index -> Programming and Compiling All times are GMT - 7 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © phpBB Group