This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/20520] allocatable arrays used uninitialized without a warning
- From: "burnus at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 20 Jun 2007 17:39:59 -0000
- Subject: [Bug fortran/20520] allocatable arrays used uninitialized without a warning
- References: <bug-20520-10294@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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