This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/29813] -std=F95/F2003: Warn or error when using a non-declared variable with implicit none
- From: "tobi at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 5 Oct 2007 21:47:11 -0000
- Subject: [Bug fortran/29813] -std=F95/F2003: Warn or error when using a non-declared variable with implicit none
- References: <bug-29813-13404@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #3 from tobi at gcc dot gnu dot org 2007-10-05 21:47 -------
Sorry if I appear talking to myself, alternative fixes that I pondered, and
that may be cleaner, would be the following:
- record both the place where a symbol is given a type and where it is first
used. Then verify that the former precedes the latter.
- in a type declaration statement, make sure that the object hasn't been used
yet.
Coming to think of it, the second option may probably be implemented with very
little effort. If it doesn't, it may be the case that it can be made to work
very simply if we recorded whether a symbol's value has been read, as opposed
to only recording whether it has been referenced as we do currently. This is
also interesting because of uninitialized warnings and may therefore be the
right way to proceed.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29813