public inbox for fortran@gcc.gnu.org
 help / color / mirror / Atom feed
* false -Wmaybe-uninitialized?
@ 2015-11-27  9:53 Anton Shterenlikht
  2015-11-27 17:04 ` Steve Kargl
  0 siblings, 1 reply; 3+ messages in thread
From: Anton Shterenlikht @ 2015-11-27  9:53 UTC (permalink / raw)
  To: fortran

$ cat z.f90 
character(:), allocatable :: z
z = "mumu"
end

$ gfortran -Wall z.f90
z.f90:2:0:

 z = "mumu"
 ^
Warning: '.z' may be used uninitialized in this function [-Wmaybe-uninitialized]
$ 

Is this warning appropriate here?
Is this statement not initialisation?

Anton

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

* Re: false -Wmaybe-uninitialized?
  2015-11-27  9:53 false -Wmaybe-uninitialized? Anton Shterenlikht
@ 2015-11-27 17:04 ` Steve Kargl
  0 siblings, 0 replies; 3+ messages in thread
From: Steve Kargl @ 2015-11-27 17:04 UTC (permalink / raw)
  To: Anton Shterenlikht; +Cc: fortran

On Fri, Nov 27, 2015 at 01:53:06AM -0800, Anton Shterenlikht wrote:
> $ cat z.f90 
> character(:), allocatable :: z
> z = "mumu"
> end
> 
> $ gfortran -Wall z.f90
> z.f90:2:0:
> 
>  z = "mumu"
>  ^
> Warning: '.z' may be used uninitialized in this function [-Wmaybe-uninitialized]
> $ 
> 
> Is this warning appropriate here?

Of course not.

> Is this statement not initialisation?


Of course it is.  You'll note that warning has '.z'
not 'z'.  '.z' is is part of its internal representation.
Use -Wno-maybe-unitialized.

-- 
Steve

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

* Re: false -Wmaybe-uninitialized?
@ 2015-11-27 19:05 Dominique d'Humières
  0 siblings, 0 replies; 3+ messages in thread
From: Dominique d'Humières @ 2015-11-27 19:05 UTC (permalink / raw)
  To: mexas; +Cc: Steve Kargl, fortran

PR60122.

Dominique

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

end of thread, other threads:[~2015-11-27 19:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-27  9:53 false -Wmaybe-uninitialized? Anton Shterenlikht
2015-11-27 17:04 ` Steve Kargl
2015-11-27 19:05 Dominique d'Humières

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).