This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: Question about -Wuninitialized
- From: Steve Kargl <sgk at troutmask dot apl dot washington dot edu>
- To: Salvatore Filippone <salvatore dot filippone at uniroma2 dot it>
- Cc: fortran at gcc dot gnu dot org
- Date: Tue, 25 Jul 2006 07:22:52 -0700
- Subject: Re: Question about -Wuninitialized
- References: <1153831272.3476.17.camel@localhost>
On Tue, Jul 25, 2006 at 02:41:12PM +0200, Salvatore Filippone wrote:
> Hi there,
> First let me say that -Wuninitialized and -Wunused are really great
> tools.
>
> However (you guessed there was an issue, didn't you?) I would be
> grateful to anybody who can illuminate me on the following.
>
> I have a small sample attached, and it generates the output shown below.
> Two questions:
>
> 1. Why is the compiler warning about "ia.0" potentially uninitialized?
> At first sight, this seems to be related to the IA(:) variable, which is
> declared INOUT, so I don't understand why it should be initialized. Or
> is it about something else? Moreover, it looks like a case simple enough
> to figure out that IA is only used if present, so no need for "May be"
> (but maybe I am wrong?)
>
> 2. Why does the compiler complain about stride.1 and ubound.0 which are
> not visible to the user? I figure they are variables internal to the
> descriptors for allocatable arrays, they should be reported under the
> array variable name...
These options are common to the gcc middle and/or backend.
The checks are done after after gfortran has generated
GIMPLE. It may be possible to mark these symbols with
something like the gccism of ATTRIBUTE_UNUSED, but I haven't
investigates the problem.
--
steve