This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/29459] Spurious warning about uninitialized optional arguments
- From: "fxcoudert at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 9 Jul 2007 22:03:16 -0000
- Subject: [Bug fortran/29459] Spurious warning about uninitialized optional arguments
- References: <bug-29459-9647@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #6 from fxcoudert at gcc dot gnu dot org 2007-07-09 22:03 -------
With the initial testcase:
module foo_mod
implicit none
contains
subroutine print_sub(fmt_acf,iu,labels)
character (len=*), intent(in), optional :: fmt_acf
integer , intent(in), optional :: iu
character (len=*), intent(in), optional :: labels(:)
if (present(iu)) then
print*,iu
end if
if (present(fmt_acf)) then
print*,fmt_acf
end if
if (present(labels)) then
write (*,*) labels
end if
end subroutine print_sub
!
end module foo_mod
we still have the following warning with -O1 -Wall:
u.f90: In function ?print_sub?:
u.f90:4: warning: ?<anonymous>? may be used uninitialized in this function
--
fxcoudert at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|fxcoudert at gcc dot gnu dot|unassigned at gcc dot gnu
|org |dot org
Status|ASSIGNED |NEW
Keywords|patch |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29459