PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

CUDA-x86.

Error when porting from intel compiler to PGI compiler

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



Joined: 22 Jul 2004
Posts: 2

PostPosted: Mon Jul 26, 2004 6:42 pm    Post subject: Error when porting from intel compiler to PGI compiler Reply with quote

Hello,
I am trying a demo version of the PGI compiler (vers5.2-1 on RedHat 7.2). The code I have to compile works perfectly using gcc or icc. With pgcc, I have got several errors:

1) PGC-S-0103-Illegal operand types for comparison operator
For example:
Code:
#include <stdio.h>

int main(){
   char c1;
   c1='\0';
   if( c1 == NULL ) printf ("hello");
   return 1;
}

It may not be regular ANSI C code, but still, it is widely accepted. I could fix that by changing the PGI stddef.h file, replacing #define NULL ((void *)0 by #define NULL 0.

2) PGC-F-0000-Internal compiler error. Macro recursion stack size exceeded
It happen for several functions of my program. Do you know a way to fix that ?
Back to top
View user's profile
mkcolg



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

PostPosted: Tue Jul 27, 2004 9:54 am    Post subject: stddef.h and macro recursion error Reply with quote

The header files we have included have been only slightly modifed from the existing system include files. Looking at the stddef.h file, found on our RedHat 7.2 system in /usr/include/linux, I see that NULL is defined as "(void *) 0". Basically, we choose to accept the system's definition of NULL. As you pointed out, you can simply re-define NULL to suit your needs or you could cast the NULL to a char.

As for the ICE, could you send a more detailed description of the problem to trs@pgroup.com? From the error message it sounds like we're doing an infinite recursive macro expansion and might be a compiler bug.

Thanks!
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