Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!iuvax!rutgers!deimos.cis.ksu.edu!unmvax!brainerd From: brainerd@unmvax.unm.edu (Walt Brainerd) Newsgroups: comp.lang.fortran Subject: Re: little problem Summary: It's illegal Message-ID: <375@unmvax.unm.edu> Date: 11 Sep 89 15:23:48 GMT References: <1349@geocub.greco-prog.fr> Organization: University of New Mexico at Albuquerque Lines: 37 In article <1349@geocub.greco-prog.fr>, simonnet@geocub.greco-prog.fr writes: > For some machines (HP1000 for example) 1 = 3 > > program toto > > call add (1) > write (1,*) 'One = ?', 1 > end > > *--------------------------------------* > subroutine add (a) > > integer *2 a > > a = a + 2 > return > > end > As I am sure many will point out, this program is illegal. The standard (p. 15-16, lines 14-20): "Actual arguments may be constants ... if and only if the associated dummy argument is a variable that is not defined during execution of the referenced external procedure." And this is one of those cases which is not likely to be caught even by a system that does quite a bit of error checking, since the error is "across" two program units. Of course, the program is also illegal because of the presence of integer *2 -- Walt Brainerd Unicomp, Inc. brainerd@unmvax.cs.unm.edu 2002 Quail Run Dr. NE Albuquerque, NM 87122 505/275-0800