|
| View previous topic :: View next topic |
| Author |
Message |
LeMaitre
Joined: 22 Jul 2004 Posts: 2
|
Posted: Mon Jul 26, 2004 6:42 pm Post subject: Error when porting from intel compiler to PGI compiler |
|
|
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 |
|
 |
mkcolg
Joined: 30 Jun 2004 Posts: 4996 Location: The Portland Group Inc.
|
Posted: Tue Jul 27, 2004 9:54 am Post subject: stddef.h and macro recursion error |
|
|
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 |
|
 |
|
|
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 © 2001, 2002 phpBB Group
|