Re: comment and IBM xlf



Dave Seaman <dseaman@xxxxxxxxxxxx> wrote:
(snip on using cpp with XLF)

The problem is that when xlf invokes cpp, it specifies the -C option,
which means "do not discard comments." This is controlled by the file
/etc/xlf.cfg, which contains the line

cppoptions = -C

among its default settings. Don't ask me why that was thought to be a
good idea.


Hmm, /* shouldn't normally exist in Fortran code, though it
might in comments.

I don't see a way to turn that option off on the command line, once it
has been enabled, but you can specify a different config file if you
like, perhaps something like:

The favorite way to override such is to write a shell script
that supplies the appropriate options and use that instead of
the command it would otherwise use. I don't know if xlf.cfg
can do that.

grep -v cppoptions /etc/xlf.cfg >myconfig
xlf -Fmyconfig foo.F

Of course, you can also use

cpp -P foo.F foo.f
xlf foo.f

My experiments indicate that you need the -P option here, even though
it's not specified in /etc/xlf.cfg.

-P indicates not to generate # lines indicating the line number
in the original source file. These allow error messages to indicate
the proper file ane line number, at least for C compilers.

Maybe -C turns them off, also.

-- glen
.



Relevant Pages

  • Re: comment and IBM xlf
    ... among its default settings. ... but you can specify a different config file if you ... xlf -Fmyconfig foo.F ... I created my own config file but without the "-C" option ...
    (comp.lang.fortran)
  • Re: comment and IBM xlf
    ... among its default settings. ... but you can specify a different config file if you ... xlf -Fmyconfig foo.F ... I created my own config file but without the "-C" option without any success. ...
    (comp.lang.fortran)
  • Re: comment and IBM xlf
    ... seems that the compiler is looking at it before passing it to cpp. ... The problem is that when xlf invokes cpp, it specifies the -C option, ...
    (comp.lang.fortran)