[J3] an amusing mistake

Bill Long longb at cray.com
Tue Aug 4 09:27:38 EDT 2020



> On Aug 4, 2020, at 6:29 AM, Robert Corbett via J3 <j3 at mailman.j3-fortran.org> wrote:
> 
> In the past few days, I had reasons to read
> the Fortran 2018 standard more closely than
> I usually read it.  As often happens when I
> read the standard closely, I saw problems
> that I overlooked before.  Yesterday, I saw
> a problem I found amusing.  (Yes, I am
> easily amused.)
> 
> Consider the two programs
> 
> -------------------------------------------
>       PROGRAM ONE
>         CHARACTER*1, C(SUM([1]))
>       END
> -------------------------------------------
>       PROGRAM TWO
>         CHARACTER*1, C(SUM([INTEGER:: 1])
>       END
> -------------------------------------------
> 
> The first program is standard conforming.
> The second program is not a conforming
> program under a strict reading of the
> standard.

Or not so strict.   It is not conforming because of a missing right paren at the end of the second statement.

With that syntax error fixed, both compile for me.

Cheers,
Bill



>  Both programs should be
> standard conforming.
> 
> I suspect there are compilers that 
> accept both programs and other compilers
> that reject both programs.  I doubt there
> are any compilers that accept the first
> program and reject the second.
> 
> Bob Corbett
> 

Bill Long                                                                       longb at hpe.com
Engineer/Master , Fortran Technical Support &   voice:  651-605-9024
Bioinformatics Software Development                      fax:  651-605-9143
Hewlett Packard Enterprise/ 2131 Lindau Lane/  Suite 1000/  Bloomington, MN  55425






More information about the J3 mailing list