[Bug middle-end/19430] taking address of a var causes missing uninitialized warning
- To: debian-gcc@lists.debian.org
- Subject: [Bug middle-end/19430] taking address of a var causes missing uninitialized warning
- From: "manu at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
- Date: Thu, 02 Mar 2017 11:34:56 +0000
- Message-id: <bug-19430-5724-NPzMrmnqns@http.gcc.gnu.org/bugzilla/>
- In-reply-to: <bug-19430-5724@http.gcc.gnu.org/bugzilla/>
- References: <bug-19430-5724@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=19430
--- Comment #30 from Manuel López-Ibáñez <manu at gcc dot gnu.org> ---
(In reply to Richard Biener from comment #29)
> What remains seems to be complaining that
>
> int i;
> foo (&i);
>
> doesn't warn. And we have another bug that
>
> int i;
> foo (&i);
> ... = i;
>
> doesn't warn for the read from i.
>
> I think both of these need a different warning level as foo may not read
> from i and foo may initialize i.
This is not what this bug is about. Please read the discussions. It seems a
waste of people's goodwill and effort over the years to close bugs as
invalid/duplicates without understanding why they were open in the first place.
This bug is about (comment #0)
extern int bar (int);
extern void baz (int *);
int
foo (int i)
{
int j;
if (bar (i)) {
// These should do the same with respect to `j':
baz (&j);
// j = 1;
}
return j;
}
If bar(i) returns false, j is never initialized. The bug implicitly assumes
that baz(&j) does initialize j, thus it satisfies the heuristic used in GCC and
still there should be a "may be" warning.
--
You are receiving this mail because:
You are on the CC list for the bug.
Reply to: