From: glen herrmannsfeldt on
Richard Maine <nospam(a)see.signature> wrote:
(snip on undefined value detection)

>> I suppose I don't know all the ways that something can become
>> undefined, nor how hard it would be to track down all those
>> ways and to set the undefined flag as needed.

> Yes. Exactly. *THAT* is the part that is hard even in principle. (Plus,
> if you managed to do it strictly, you'd get lots of complaints because
> suddenly function side effects wouldn't work for one.)

I am not sure how strict you mean. If variables are either static
or automatic, compiler choice, then they may or may not become
undefined on function return. If they really are static, with
the SAVE attribute, then they should not become undefined.

It seems,though, that there are programs around assuming save,
but not requesting it.

-- glen
From: Richard Maine on
glen herrmannsfeldt <gah(a)ugcs.caltech.edu> wrote:

> Richard Maine <nospam(a)see.signature> wrote:
> (snip on undefined value detection)
>
> >> I suppose I don't know all the ways that something can become
> >> undefined, nor how hard it would be to track down all those
> >> ways and to set the undefined flag as needed.
>
> > Yes. Exactly. *THAT* is the part that is hard even in principle. (Plus,
> > if you managed to do it strictly, you'd get lots of complaints because
> > suddenly function side effects wouldn't work for one.)
>
> I am not sure how strict you mean.

I mean look at the list in the standard of ways that variables can
become undefined. Look at every item in it and cover every case. You
aren't going to do it by trying to come up with it off the top of your
head without actually studying the list. Anyway, I sure can't. In fact,
J3 kept forgetting ways and adding to that list; I suspect it stil
misses some, but it is at least a good start. You seem to be thinking
about only one of the 20 or so items in the list.

--
Richard Maine | Good judgment comes from experience;
email: last name at domain . net | experience comes from bad judgment.
domain: summertriangle | -- Mark Twain
From: robin on
A Watcher wrote in message ...
>At work we have a large legacy application with thousands of lines of
>code and hundreds of subroutines. I've worked on it for years and now
>they've assigned a jr programmer to do maintenance work as I've already
>retired twice. The new person has a computer science degree but has
>never seen fortran before.
>
>She introduced a coding error that I had a real hard time tracing down.
> She set x=0 where x was an allocatable array that hadn't been
>allocated yet. What happened was some other data got set to zero, but
>the program didn't blow up until the zero data caused problems.
>
>Should that have been caught at run time? I have turned on all of the
>runtime error checking that I could find. The program runs on an
>elderly RS6000 AIX system and uses the IBM xlf compiler.

The results from a programming error are never "strange" in the sense
that anything can happen.
Always expect the unexpected.