Re: PGF90 problem with adjustl(trim(..))

From: James Van Buskirk (
Date: 08/09/04

Date: Mon, 09 Aug 2004 19:11:43 GMT

"Paul Van Delst" <> wrote in message

> But if I do,
> write(*,'(/5x, "This is the busted "& ! Removed the , before the &
> &"sequence output:")') ! Added the & before the first

> Both pgf90 and intel give me
> This is the busted sequence output:
> but Lahey gives me:
> This is the busted "sequence output:

I just want to comment on this snippet. Without the second
ampersand, i.e.:

program continue
   write(*,'(/5x, "This is the busted "&
                 "sequence output:")')
end program continue

Both LF95 5.70f and CVF 6.6C (properly) hate it:

C:\LF9556\James\clf\continue>lf95 -f95 continue
Lahey/Fujitsu Fortran 95 Express Release 5.70f S/N: XXXXXXXX
Copyright (C) 1994-2004 Lahey Computer Systems. All rights reserved.
Copyright (C) 1998-2004 FUJITSU LIMITED. All rights reserved.
Registered to: James Van Buskirk
-nap -nc -nchk -nchkglobal -concc
-dal -ndbl -ndll -f95 -nfix
-ng -nin -ninfo -li -nlst
-nlong -maxfatals 50 -o1 -npause -nprefetch
-nprivate -npca -nquad -nsav -staticlib
-nstaticlink -stchk -tp -trace -ntrap
-w -nwide -winconsole -nwo -nxref

Compiling file continue.f90.
Compiling program unit continue at line 1:
  1495-W: "continue.f90", line 2: The first nonblank character of a cont
inued line must be '&' in a character context continuation.
  3134-W: "continue.f90", line 2: In the format specification, omission
of the format item separator ',' after character string edit descriptor
is not standard-conforming.
Encountered 0 errors, 2 warnings in file continue.f90.
Microsoft (R) Incremental Linker Version 6.00.8447
Copyright (C) Microsoft Corp 1992-1998. All rights reserved.


    This is the busted sequence output:

C:\LF9556\James\clf\continue>df /stand:f95 continue
Compaq Visual Fortran Optimizing Compiler Version 6.6 (Update C)
Copyright 2003 Compaq Computer Corp. All rights reserved.

continue.F90(3) : Warning: Missing ampersand in continued character cons
                 "sequence output:")')
continue.F90(2) : Error: Missing mandatory separating blank
   write(*,'(/5x, "This is the busted "&
continue.F90(2) : Error: Syntax error, found ''' when expecting one of:
   write(*,'(/5x, "This is the busted "&

But with the ampersand:

program continue
   write(*,'(/5x, "This is the busted "&
                 &"sequence output:")')
end program continue

Both compilers like it with output:

     This is the busted "sequence output:

This seems correct to me, and completely unambiguous. The
continuation isn't breaking a character constant at a tricky
point as it would be if two apostrophes were being separated.
I think the compiler should consider quotation marks to be
nothing special when parsing a string delimited by apostrophes;
only at the next stage, after the apostrophe-delimited string
has been parsed, should the special properties of the
quotation-delimited strings be considered. In fact, the
compiler should in principle be able to pass the whole format
expression to the run-time library for parsing. If any
compiler prints the second example without the wierd-looking
quotation mark, I think it's time for a bug report.

write(*,*) transfer((/17.392111325966148d0,6.5794487871554595D-85, &
6.0134700243160014d-154/),(/'x'/)); end

Relevant Pages

  • Re: PL/I string representations
    ... >> of the language, so it was interesting to me, hopefully it will be to ... I found a workable compiler for Fortran in 1971 (with a bug ... >> The specified length is the minimum, and each time a character ... >> string is assigned to E, the length is stored with it. ...
  • Re: To "TAB" or not to "TAB"
    ... > negative I want etc. in character strings now in every compiler I'm ... If there is a graphic character in the string, ... that you are saying that the compiler should do no special processing, ...
  • Re: when substring equals string
    ... CHARACTER:: String ... The unit number is attached to a file via an OPEN statement. ... question is about a character variable, ... Like in the way the operator invoked the compiler. ...
  • Re: Newbie: Is it possible for a function to return a String or Character Arrays?
    ... The hard part about this is not returning a string, ... If you wanted a fixed-length string returned, you could declare the ... If your f95 compiler implements the allocatable stuff TR (or if you ... I don't think that the allocatable TR included allocatable character ...
  • Re: replace
    ... string is read from a file, it really does have backslashes in it. ... you (take a string containing escape sequences and translate them to ... their character equivalents). ... The compiler translates \n into the ...