diff options
author | allen <allen@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 2003-02-06 07:05:06 +0000 |
---|---|---|
committer | allen <allen@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 2003-02-06 07:05:06 +0000 |
commit | a4dd5d7501c8becba423735f0528c3f4400d3d97 (patch) | |
tree | c97f8a1e7141af5e143728de1fbb283c123ad845 /src | |
parent | 88dfadce359968649b6308abfa9f281925328409 (diff) |
Entry from Jonathan Thornburg
E12 I'm getting wierd syntax errors in Fortran code, with an extra
garbage character (often $ or &) stuck in the middle of a CCTK_INFO()
or CCTK_WARN() or CCTK_EQUALS() call after it has been processed.
You have probably used Fortran (either 77 or 90) line continuation
in a macro call
c example of broken Fortran code fragment
if (CCTK_EQUALS(test,"on")) then
test_state = 1
else if (CCTK_EQUALS(test,
$ "off")) then
test_state = 3
end if
The $ is in column 6 is the Fortran 77 standard way of doing
a line continuation. This doesn't work, because CCTK_EQUALS()
is a macro, and macros use C lexical conventions (regardless of
what language your code is written in). To continue a line in a
macro, use the same technique you would in C, i.e. put a backslash
( \ ) at the end of the line to be continued (note there must *not*
be any whitespace after the \ !!). For example, the above code
should be written
c example of valid Fortran code fragment
if (CCTK_EQUALS(test,"on")) then
test_state = 1
else if (CCTK_EQUALS(test, \
"off")) then
test_state = 0
end if
git-svn-id: http://svn.cactuscode.org/flesh/trunk@3125 17b73243-c579-4c4c-a9d2-2d5706c11dac
Diffstat (limited to 'src')
0 files changed, 0 insertions, 0 deletions