------- Comment #7 from burnus at gcc dot gnu dot org 2007-06-20 17:39 -------
> Even ICC 8.1 accepts the code without warnings
I never found ifort (or sunf95) especially picky - contrary to NAG f95, which
is often too picky.
I'm in favour of giving a warning; actually I would even warn by default and
not only when using -W*. There is hardly any code imaginable which makes sense
and uses not allocated variables. (The only thing which comes into my mind is
code where the non-allocated variables are never accessed: dead if branch, not
calling the subroutine w/ that variable etc.)
NAG f95:
Error: x.f90, line 5: ALLOCATABLE array B used but never ALLOCATEd
detected at END@<end-of-statement>
Error: x.f90, line 5: ALLOCATABLE array A used but never ALLOCATEd
detected at END@<end-of-statement>
g95: Nothing by default, but with -Wall:
Warning (147): Variable 'b' at (1) is used and never allocated
Warning (112): Variable 'a' at (1) is set but never used
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20520