------- Additional Comments From eedelman at acclab dot helsinki dot fi  
2004-12-25 00:41 -------
I think the result given by gfortran is correct.  Quote from "Fortran 95
handbook" by Adams, Brainerd et al., section 3.3.1.1

"""
To continue a character constant so that the continued line is indented, an
ampersand must be used as the first character of the continued line, as in:

NAME = "Mary K. W&
       &illiams"

In this case, the first nonblank character on the next line [...] must be an
ampersand because Williams is split between lines; _otherwise_ [emphasis mine]
the blanks at the beginning of the second line will be included as part of the
character constant
"""

If I understand this correctly, the & is not needed if you do want the blanks at
the beginning of the line included in the character constant (In your example
you probably do not want that, but how is the compiler supposed to know?).

On the other hand, it seems that the intel compiler wants the & anyway:

$ ifort -e95 char-cont-wrong.f90
fortcom: Warning: char-cont-wrong.f90, line 4: Missing ampersand in continued
character constant
       world!"
-------^

so perhaps I'm wrong.

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19101

Reply via email to