Print

Print


On Friday 28 June 2002 15:17, John A. Turner wrote:
> Aleksandar Donev wrote:
> > Intel's compiler gives an error for the following function because it
> > does not assign a return result:
> >
> > function test(x)
> >     write(*,*) "error!"
> >     stop
> > end function test
> >
> > Is this kind of compiler behavior allowed? If yes, why should a silly
> > compiler be allowed to play so smart (it should of course give a
> > warning)...
>
> actually, the silly compiler is completely correct - the function
> result *must* be assigned (or otherwise given a value), even if the
> silly function is just going to print a msg and stop
>
Why use a function when no return value is expected, only a side effect?

--
Tim Prince