This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Informing gcc that a function initializes a pointer target


On Fri, Oct 11, 2013 at 4:57 PM, Ian Pilcher <arequipeno@gmail.com> wrote:
> I've run into a situation where I'm getting a spurious (I think) "may be
> used uninitialized" warning.
>
>   https://bugzilla.redhat.com/show_bug.cgi?id=1018422
>
> In this case, the variable is initialized when its address is passed to
> another function.
>
> This situation made me wonder if there's some sort of function (or
> parameter) attribute that I could use to inform the compiler that the
> function does, in fact, initialize the variable.

This does look like a bug.

There is no need for such an attribute.  When the compiler sees that a
pointer to the variable is passed to an unknown function, it assumes
that the variable has been initialized, which is really the only
reasonable behaviour.

Consider filing your bug report in the GCC bug queue, as described at
http://gcc.gnu.org/bugs/ .  I have no idea what happens to GCC bugs
filed in the redhat bug queue.

Ian


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]