[CIG-MC] pgi compilers
Bill Appelbe
bill at vpac.org
Mon Nov 8 12:04:23 PST 2010
Hi All:
The problem is that NULL is heavily used/defined, but not part of the
C language. The usual interpretation is that NULL means "null
pointer" (char*)0 [the PGI interpretation], but another view is that
NULL is the null char.
The simplest approach is to override all of this and just use #define
NULL 0
Then the automatic conversions all work. PGI should not really try to
force its view of what NULL means (albeit the common view) on users,
as NULL is not part of the standard (while encouraging users not to
use idioms like comparing chars to NULL.
I'll chat with the Portland folks about this next week ...
On 09/11/2010, at 3:30 AM, Bianco, Todd wrote:
> Hello,
> My apologies, but I am not sure to whom this email is being sent.
> This is Todd Bianco, I am a postdoc at Brown working with Marc
> Parmentier. I have an unsupported version of CitcomCU that I have
> been using for years, and compiling with GNU. The department at
> Brown would like me to use PGI compilers, but I have never
> successfully compiled Citcom with the PGI compilers. I have searched
> the mail archives and help topics, but did not find a discussion
> about PGI compiler issues.
>
> The problem is with comparisons to NULL. For example, in the current
> version of CitcomCU, line 446 in Parsing.c will cause the following
> error:
>
> PGC-S-0103-Illegal operand types for comparison operator
>
> This is because of how NULL is defined. A similar problem for a
> different code, a and potential solution, are discussed here:
> http://www.pgroup.com/userforum/viewtopic.php?p=46&sid=86257394adf1934ff26676ddc7a1ad2a
> I do not fully understand the discussion.
>
> The error listed above is simply a warning or ignored when I use GNU
> compilers. Can the current version of CitcomCU can be compiled with
> PGI compilers? Did CIG address this problem to get CitcomCU to
> compile, or am I the only user reporting this problem? Do I need to
> set a different definition of NULL in stddef.h? Can I override the
> definition of NULL more locally, for example in global_defs.h, as I
> do not have permission to edit stddef.h on my cluster? Any help is
> appreciated.
>
> Regards,
> Todd
> _______________________________________________
> CIG-MC mailing list
> CIG-MC at geodynamics.org
> http://geodynamics.org/cgi-bin/mailman/listinfo/cig-mc
Cheers -- Bill
------------------------------------------------------------
Bill Appelbe +61 39925 4648
CEO, VPAC mobile)+61 0418 557115
(fax) +61 3 9925 4647
www.vpac.org bill at vpac.org
Jane Douglas +61 3 9925 4734
Executive Assistant jdouglas at vpac.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://geodynamics.org/pipermail/cig-mc/attachments/20101109/cb95b96d/attachment.htm
More information about the CIG-MC
mailing list