Re: Informing gcc that a function initializes a pointer target

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Oct 11, 2013 at 4:57 PM, Ian Pilcher <arequipeno@xxxxxxxxx> 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 of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux