This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/59537] No "Automatic array cannot have an initializer", for -finit-real without a SAVE statement present in subroutine
- From: "bugs at stellardeath dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 12 May 2014 14:39:15 +0000
- Subject: [Bug fortran/59537] No "Automatic array cannot have an initializer", for -finit-real without a SAVE statement present in subroutine
- Auto-submitted: auto-generated
- References: <bug-59537-4 at http dot gcc dot gnu dot org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59537
--- Comment #6 from Lorenz HÃdepohl <bugs at stellardeath dot org> ---
>> Nonetheless, code that compiles without -finit-real should also compile
>> with -finit-real, right?
>
> I disagree: C506 states that automatic object cannot be initialized. What is
> wrong is that it depends on the presence of the SAVE statement without a saved
> entity list.
Well, I guess it depends on what meaning one wants to assign to the flag
-finit-real, which is anyway not something the standard specifies, right?
Do you really want to restrict the usage of -finit-real to programs where every
last variable is initializable?
I always use -finit-real as a kind of debug feature, with -finit-real=snan, to
check for the use of uninitialized values. I did never expect that it should
have a well defined, standard-mandated effect.