Re: Preprocessor directives ?

From: James Giles (
Date: 02/01/04

Date: Sat, 31 Jan 2004 23:47:21 GMT

Pierre Asselin wrote:
> Richard Edgar <> wrote:
>> Steve Lionel wrote:
>>> Lastly, I'll note that use of such directives will make your code
>>> non-portable, though the extent of the non-portability depends on
>>> exactly what you end up using.
>> Minor nitpick.... it needn't. I've used a code which did some makefile
>> magic - run cpp on the source code, and feed the result to the compiler.
> Minor nitpic squared, the C preprocessor operates on C-language
> tokens, not characters. Not all legal Fortran constructs are made
> up of legal C tokens, so the preprocessor may choke! But this is
> unusual. Just another little thing to watch for.

In particular, be very careful of character concatenation (//) on
versions of the C preprocessor that have been extended to understand
C++ syntax. In C++, the slash-slash is a comment marker.

J. Giles