This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/20520] allocatable arrays used uninitialized without a warning



------- 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]