Path: utzoo!attcan!uunet!husc6!bloom-beacon!bu-cs!purdue!i.cc.purdue.edu!j.cc.purdue.edu!pur-ee!uiucdcs!uxc.cso.uiuc.edu!uxe.cso.uiuc.edu!mcdonald From: mcdonald@uxe.cso.uiuc.edu Newsgroups: comp.lang.fortran Subject: Re: fortran problem Message-ID: <50500054@uxe.cso.uiuc.edu> Date: 12 Jun 88 13:36:00 GMT Lines: 21 Nf-ID: #R:<8806111222.AA06982@jade.berkele:-38:uxe.cso.uiuc.edu:50500054:000:752 Nf-From: uxe.cso.uiuc.edu!mcdonald Jun 12 08:36:00 1988 > CALL TRY ( 1 ) > WRITE (1,*) 'THIS SHOULD BE PRINTED ON UNIT 1' > I=1 > WRITE (*,*) ' I (SHOULD BE 1) = ',I > STOP > END > SUBROUTINE TRY ( KUKU ) > KUKU = 8 > RETURN > END This is the classic expression of a common stupid Fortran bug. It is not legal Fortran for a subroutine to redefine the value of a constant or expression. It doesn't matter WHAT a given compiler does with it: it is an illegal construct. It is up to the programmer to write correct programs. Fortran compilers are required to give correct output with correct programs. If you feed them a program with a bug in it, the resulting output is "undefined" , which means essentially anything is "correct" behaviour of the compiler.