This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/42884] GCC (v4.3.3) fails to detect uninitialized variable
- From: "rguenth at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 27 Jan 2010 16:51:08 -0000
- Subject: [Bug c/42884] GCC (v4.3.3) fails to detect uninitialized variable
- References: <bug-42884-18720@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #16 from rguenth at gcc dot gnu dot org 2010-01-27 16:51 -------
(In reply to comment #15)
> (In reply to comment #14)
> > As diglen has its address taken and we do not warn about uninitialized use
> > of memory we do not warn.
> >
>
> I get that the compiler can't track if an external function actually
> initializes a value through a pointer, but the "diglen = sizeof..." line should
> be good enough for the positive case. In the false path though "diglen" is not
> initialized nor its address taken.
No, it's an implementation detail. Uninitialized variable use tracking
works with detecting uses of SSA name default definitions. Memory
is not in SSA form so this mechanism does not work.
Uninitialized memory detection is not done at all.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42884