public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Informing gcc that a function initializes a pointer target
@ 2013-10-11 23:57 Ian Pilcher
  2013-10-12  0:19 ` Ian Lance Taylor
  0 siblings, 1 reply; 3+ messages in thread
From: Ian Pilcher @ 2013-10-11 23:57 UTC (permalink / raw)
  To: gcc-help

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.

Thanks!

-- 
========================================================================
Ian Pilcher                                         arequipeno@gmail.com
Sometimes there's nothing left to do but crash and burn...or die trying.
========================================================================

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

* Re: Informing gcc that a function initializes a pointer target
  2013-10-11 23:57 Informing gcc that a function initializes a pointer target Ian Pilcher
@ 2013-10-12  0:19 ` Ian Lance Taylor
  2013-10-12  3:23   ` Ian Pilcher
  0 siblings, 1 reply; 3+ messages in thread
From: Ian Lance Taylor @ 2013-10-12  0:19 UTC (permalink / raw)
  To: Ian Pilcher; +Cc: gcc-help

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

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

* Re: Informing gcc that a function initializes a pointer target
  2013-10-12  0:19 ` Ian Lance Taylor
@ 2013-10-12  3:23   ` Ian Pilcher
  0 siblings, 0 replies; 3+ messages in thread
From: Ian Pilcher @ 2013-10-12  3:23 UTC (permalink / raw)
  To: Ian Lance Taylor; +Cc: gcc-help

On 10/11/2013 07:19 PM, Ian Lance Taylor wrote:
> 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.

Done.

  http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58698

-- 
========================================================================
Ian Pilcher                                         arequipeno@gmail.com
Sometimes there's nothing left to do but crash and burn...or die trying.
========================================================================

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

end of thread, other threads:[~2013-10-12  3:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-10-11 23:57 Informing gcc that a function initializes a pointer target Ian Pilcher
2013-10-12  0:19 ` Ian Lance Taylor
2013-10-12  3:23   ` Ian Pilcher

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