Home > Archive > Fortran > December 2005 > ftnchek illegal character bug?
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
ftnchek illegal character bug?
|
|
| kern.matthias@gmx.de 2005-12-08, 7:59 am |
| In my f77 code there are lines like:
real*8 h0 !description
Everytime a have a line like containing a variable, which starts with
an 'h', I get the message
illegal character '!' from ftnchek. Is this a bug or is there really
something wrong in this line.
greeting Matthias
| |
| meek@skyway.usask.ca 2005-12-08, 7:59 am |
| In a previous article, "kern.matthias@gmx.de" <kern.matthias@gmx.de> wrote:
>In my f77 code there are lines like:
>
>real*8 h0 !description
>
>Everytime a have a line like containing a variable, which starts with
>an 'h', I get the message
>illegal character '!' from ftnchek. Is this a bug or is there really
>something wrong in this line.
>greeting Matthias
>
... maybe it's thinking Hollarith ? What about hh0 ?
Chris
| |
| Dan Nagle 2005-12-08, 7:59 am |
| Hello,
m @skyway.usask.ca wrote:
> In a previous article, "kern.matthias@gmx.de" <kern.matthias@gmx.de> wrote:
>
>
> ... maybe it's thinking Hollarith ? What about hh0 ?
Or maybe ftncheck doesn't recognize ! as a comment.
It's not standard f77.
> Chris
--
Cheers!
Dan Nagle
Purple Sage Computing Solutions, Inc.
| |
| Richard E Maine 2005-12-08, 7:15 pm |
| kern.matthias@gmx.de <kern.matthias@gmx.de> wrote:
> In my f77 code there are lines like:
>
> real*8 h0 !description
>
> Everytime a have a line like containing a variable, which starts with
> an 'h', I get the message
> illegal character '!' from ftnchek. Is this a bug or is there really
> something wrong in this line.
There is something wrong with the line. I think you are being mislead by
thinking that this has anything to do with variable names that start
with h. Instead, take the error message literally - the character '!' is
the problem. This form of commenting is not standard f77. It was a
widely accepted f77 extension, and is standardized in f90, but it isn't
standard f77. Since the error message says that the character '!' is the
problem, and indeed that character is invalid f77 here, I think that's
pretty conclusive.
--
Richard Maine | Good judgment comes from experience;
email: my first.last at org.domain| experience comes from bad judgment.
org: nasa, domain: gov | -- Mark Twain
| |
| Dick Hendrickson 2005-12-08, 7:15 pm |
|
kern.matthias@gmx.de wrote:
> In my f77 code there are lines like:
>
> real*8 h0 !description
>
> Everytime a have a line like containing a variable, which starts with
> an 'h', I get the message
> illegal character '!' from ftnchek. Is this a bug or is there really
> something wrong in this line.
> greeting Matthias
>
Do you get the same message if you change the "h" to some
other letter?
Remember, blanks are not significant in F77, so your line
sort of looks like
real*8h0 !description
and it's possible for parsers to get and think
the 8h is the start of a hollerith constant. It's also
possible that the 7 spaces after the 0 add to the confusion
because then the "!" occurs right after the constant.
Hollerith isn't really standard, so parsers sometimes have
funny rules for how they (mis)parse it.
Dick Hendrickson
| |
| Lynn McGuire 2005-12-09, 7:18 pm |
| > In my f77 code there are lines like:
>
> real*8 h0 !description
>
> Everytime a have a line like containing a variable, which starts with
> an 'h', I get the message
> illegal character '!' from ftnchek. Is this a bug or is there really
> something wrong in this line.
Did you email the author ? I emailed him about a couple of
w s ago and he responded within a day. Was very nice.
Lynn
| |
| Charles Russell 2005-12-09, 7:18 pm |
| Richard E Maine wrote:
>
> There is something wrong with the line. I think you are being mislead by
> thinking that this has anything to do with variable names that start
> with h. Instead, take the error message literally - the character '!' is
> the problem. This form of commenting is not standard f77. It was a
> widely accepted f77 extension, and is standardized in f90, but it isn't
> standard f77. Since the error message says that the character '!' is the
> problem, and indeed that character is invalid f77 here, I think that's
> pretty conclusive.
>
There is a switch in ftnchek that checks for strict compliance with the
standard. By default, trailing comments are ignored. So - what
switches is the OP using?
| |
| kern.matthias@gmx.de 2005-12-13, 4:13 am |
| I have a lot of trailing comments in my code, but I only get the error
message, if there is a variable declaration within this line and this
variable starts with an 'h'. If I put another literal in front of the
'h', I do not get an error message. I know that trailing comments
starting with '!' are not f77 standard. But as far as I know, ftnchek
ignores this by default.
|
|
|
|
|