Re: undefined variable problem



On 2007-03-30, John Appleyard <spamtrap@xxxxxxxxxxxxxx> wrote:

Check out Catherine's reply again. I think you may have misunderstood
what the compiler means by "undefined". It doesn't mean "not allocated"
or "not declared" or "not associated". It means "used before set" -
i.e. no value has been assigned to a since it was created (by allocation
or whatever). It is an error to use the value of a variable if it has
never been given a value, and that is what the compiler is complaining
about.

Yep. I indeed misunderstood what the compiler was telling me.
It has been a while since i've compiled my code with NAGWare's
f95 and the -C=undefined option. Now that I'm compiling with
this setup, it seems that there are quite some places where I use
undefined variables... djeez, do i love this compiler switch! :-)

Thanks,
Bart

--
"Share what you know. Learn what you don't."
.



Relevant Pages

  • Re: Delphi Product Manager questioned
    ... Michael C. wrote: ... I think you've misunderstood my postings. ... I have never, ever, ever opposed a 64-bit compiler ...
    (borland.public.delphi.non-technical)
  • Re: Software vs hardware floating-point [was Re: What happened ...]
    ... so that it could unroll& interleave as many of them as ... Sorry, I meant that the math code needs to be part of the compiler team, ... I misunderstood you. ... But my point that the facilities would be useful to other people as ...
    (comp.arch)
  • Re: Compiles with gcc, not CC
    ... >I've just almost completed a programming assignment. ... You've misunderstood what these programs are. ... end that runs a C compiler. ... symlink to gcc. ...
    (comp.os.linux.development.apps)
  • Re: Sweeney presentation "The Next Mainstream Language"
    ... Specify int to be more specific than real. ... possibly helped by programmer annotations or checks. ... test just before the access to make the compiler see that the index is ... he included compiler-checked manual region allocation in Cyclone. ...
    (comp.lang.functional)
  • Re: ANNOUNCE: Colibri version 0.2
    ... It's the data dependencies that are the problem, unless the compiler ... only occur when the memory space is exhausted, so there isn't much to do. ... you're truly stuck as any recovery ... Allocation failures are a PITA... ...
    (comp.lang.tcl)