public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/50334] New: interaction between -Wuninitialized and -finit-real=snan
@ 2011-09-08 16:27 arnaud02 at users dot sourceforge.net
  2011-09-08 16:41 ` [Bug fortran/50334] " pinskia at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: arnaud02 at users dot sourceforge.net @ 2011-09-08 16:27 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50334

             Bug #: 50334
           Summary: interaction between -Wuninitialized and
                    -finit-real=snan
    Classification: Unclassified
           Product: gcc
           Version: 4.6.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: arnaud02@users.sourceforge.net


Considering
      subroutine qq(aa)
      aa = bb + 1 ! bb unset
      end subroutine

>gfortran461 -O3 -Wuninitialized -c qq.f
qq.f: In function 'qq':
qq.f:2:0: warning: 'bb' is used uninitialized in this function
[-Wuninitialized]
>gfortran461 -O3 -Wuninitialized -finit-real=snan -c qq.f
>

The absence of compile-time warnings in the second case surprised me for a
while until I tracked it down to "-finit-real=snan". "-finit-real=snan" is a
killer feature of gfortran, badly missing in Intel Fortran for instance. It is
somewhat regrettable that this option disables the compile-time warnings about
uninitialized variables as "snan" in this case is used to find unset variables
at run-time.

Could you at least add a note in the description of "-finit-real=" explaining
that "-finit-real=" will disable the warnings about uninitialized variables
even for "snan"?


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2011-11-08  8:13 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-09-08 16:27 [Bug fortran/50334] New: interaction between -Wuninitialized and -finit-real=snan arnaud02 at users dot sourceforge.net
2011-09-08 16:41 ` [Bug fortran/50334] " pinskia at gcc dot gnu.org
2011-09-08 17:06 ` kargl at gcc dot gnu.org
2011-11-08  8:05 ` [Bug fortran/50334] interaction between -Wuninitialized and -finit-* fxcoudert at gcc dot gnu.org
2011-11-08  8:13 ` fxcoudert at gcc dot gnu.org
2011-11-08  8:50 ` fxcoudert at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).