http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47307

--- Comment #2 from Dominique d'Humieres <dominiq at lps dot ens.fr> 2011-01-15 
21:50:05 UTC ---
> In fact, the array 'lopt' is not initialized in the code, however, the 
> compiler
> does not give warning about that. I try the same code with g95, it give a
> warning message 'used but not set' about 'lopt'.

Add lopt(1,1) = 0 at the beginning of your code and the g95 warning just
disappears!
So don't rely too much of this kind of warning.

> Any suggestions or comments? Thanks in advance!

Searching bugzilla for "uninitialized" in the subject yields 52 entries for
open pr (not counting those closed as INVALID, DUPLICATE, WONTFIX, ...). I let
you browse the list to check if this pr is a duplicate of one of those (look
for instance to pr24639, my choice is pr27120).

As far as I understand the problem, 
(1) it could be as difficult to solve as running the code itself (think of an
array of 10**9 elements set through a spaghetti code and forgetting to set only
one element). Note this apply also to duplicate initialization (as in Fortran
legalese;-).
(2) the responsibility to use only set variables is on the user, not on the
compiler.

Reply via email to