At 16:38 09-08-2000 +0200, I wrote:
>
>Dear Colleagues,
Thanks to all who reacted to my query.
As it often happens there followed in interesting discussion off the original
problem.
assign 777 to label
label: if
....
end if label
777 continue
is now prohibited (maybe for this reason of causing confusion)
I soon found out that in my first example there was an error,
not detected by one compiler.
So I came to the second version of the test program
IMHO standard conforming, giving INTERNAL compiler errors in the case where
the
first error was correctly detected.
So what is your opinion on this:
k = 1
if: if( k > 3) then
k = -1
else if
k = 0
end if if
[....]
>From different compilers I get contradicting results:
>
>! [JvO] 2000-08-09 IF.f90
> program T_IF
> k = 1 ; if = 2
> if: if(if > 3) then
> else
> end if if
> end program T_IF
>
>ONE>>> D:\FORTRAN\CURSUS\F90\5>ftn95 if.f90
>
>[FTN95/WIN32 Ver. 2.00 Copyright(c) Salford Software Ltd 1993-2000]
> Licensed to: Mr J. van Oosterwijk
> Organisation: TU DELFT
>
>0005) if: if(if > 3) then ! IF
>WARNING - This construct label is the same name as a Fortran keyword -
> possible misplaced ':'
>0003) k = 1 ; if = 2
>WARNING - Variable 'K' has been given a value but never used
> NO ERRORS, 2 WARNINGS [<T_IF> FTN95/WIN32 v2.00]
>
>TWO>>> D:\FORTRAN\CURSUS\F90\5>f90 -c if.f90
>
>cf90-558 error on line 5 of if.f90: "IF" has been used as a variable,
>therefore
>it must not be declared as a construct-name.
>
>f90: Copyright Absoft Corporation 1994-1998 mV2; Cray Research, Inc.
>1994-1996 C
>F90 (2.x.x.x f36t87) Version 2.0 Wed Aug 9, 2000 16:10:55
>f90fe: 11 source lines
>f90fe: 1 Errors, 0 Warnings, 0 Other messages, 0 ANSI
>
>After that a new try:
>
>! [JvO] 2000-08-09 IF2.f90
> program T_IF
> k = 1
> !! IF not declared !!
> if: if(if > 3) then
> k = -1
> else
> k = 0
> end if if
>
> end program T_IF
>
>D:\FORTRAN\CURSUS\F90\5>f90 -c if2.f90
>
>[FTN95/WIN32 Ver. 2.00 Copyright(c) Salford Software Ltd 1993-2000]
> Licensed to: Mr J. van Oosterwijk
> Organisation: TU DELFT
>
>0005) if: if(if > 3) then
>WARNING - This construct label is the same name as a Fortran keyword -
> possible misplaced ':'
>WARNING - Variable 'IF' has been used without being given an initial value
>0003) k = 1
>WARNING - Variable 'K' has been given a value but never used
> NO ERRORS, 3 WARNINGS [<T_IF> FTN95/WIN32 v2.00]
>
>D:\FORTRAN\CURSUS\F90\5>f90 -c if2.f90
>
>tmod-2612 INTERNAL : Internal: IR xlate; SOURCE line: 5, file: if.f90;
>INTERNAL
>site: 1341, tag: 0, val: -1
>tmod-2612 INTERNAL : Internal: IR xlate; SOURCE line: 5, file: if.f90;
>INTERNAL
>site: 1341, tag: 0, val: -1
>tmod-2612 INTERNAL : Internal: IR xlate; SOURCE line: 5, file: if.f90;
>INTERNAL
>site: 15950, tag: 0, val: -1
--
Meilleures Salutations,
Kindest Regards,
/---
Jan van Oosterwijk
Computing Centre
Delft University of Technology
Postbus 354
2600 AJ Delft
Netherlands / Pays-Bas
mailto:[log in to unmask]
Phone: +31 15 278 50 17
Fax: +31 15 278 37 87
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|