At 06:57 PM 11/19/2004, Stuart Midgley wrote:
>Hi All
>
>OK, here is a perplexing one. I don't have the standard at hand, so I
>can't check for a few days... but at least 3 compilers have a problem.
>
>This little piece of code
>
> program test
> write(*,*) 1d-1/-2d-1
> end program test
>
>produces compile time errors in at least 3 compilers and another 3
>compilers pass it fine.
>
>ifort:
> compiles and runs
>
>pgf90:
> compiles and runs
>
>HP/Compaq/DEC Alpha F90:
> compiles and runs
>
>NAG:
> Error: test.f90, line 2: syntax error
> detected at /@-
> ***Malformed statement
> [f95 terminated - errors found by pass 1]
>
>g95:
> In file test.f90:2
>
> write(*,*) 1d-1/-2d-1
> 1
> Error: Syntax error in WRITE statement at (1)
>
>lf95:
> 1035-S: "test.f90", line 2, column 21: Invalid operator.
> Encountered 1 error, 0 warnings in file test.f90.
>
>
>so who is right and who has a bug?
>Stu.
Insufficient information to answer, according to my understanding. If a
compiler which accepts this has no option to flag it as an extension to the
standard, then that's a bug.
$ ifort -stand stu.f
Intel(R) Fortran Compiler for 32-bit applications, Version 8.1 Build
20041019
Z Package ID: w_fc_pu_8.1.023
Copyright (C) 1985-2004 Intel Corporation. All rights reserved.
stu.f(2) : Warning: Non-standard extension
write(*,*) 1d-1/-2d-1
-------------------------------^
stu.f(1) : Warning: Fixed form source is an obsolescent feature in Fortran 95.
program test
Tim Prince
|