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: "ebertakis at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 20 Mar 2005 19:22:49 -0000
- Subject: [Bug fortran/20520] allocatable arrays used uninitialized without a warning
- References: <20050317173138.20520.ebertakis@gmail.com>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From ebertakis at gmail dot com 2005-03-20 19:22 -------
(In reply to comment #4)
This case is slightly different. The compiler just warns you that you are using
variable x before its value have been defined. Many programmers (that have bad
programming habits :-) probably that includes myself!) take for granted that
variables have an initial value equal to 0 once their memory space is reserved
upon definition as e.g. real. That is not always true and is heavily dependant
on the compiler that is used. Many compilers fill the variables with garbage
when they are first declared. See also the Fortran FAQ (paragraph 3.2.3):
http://www.faqs.org/faqs/fortran-faq/
That is why you got that warning. I believe it is not related to the array usage.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20520