This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/33279] Failed to warn uninitialized stack variable
- From: "hjl at lucon dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 2 Sep 2007 13:56:13 -0000
- Subject: [Bug middle-end/33279] Failed to warn uninitialized stack variable
- References: <bug-33279-682@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #5 from hjl at lucon dot org 2007-09-02 13:56 -------
(In reply to comment #4)
> bar (frame.value);
> That call to bar causes the whole frame struct escapes here, not just the array
> element.
>
> void bar (mpz_t);
> is really:
> void bar(int*);
>
> because of array decaying in parameters.
>
> Again with pointer arithmetic, bar can get back to the original struct and be
> able to set prev. So again there is no bug here.
>
When bar is called from
mpz_t value;
...
bar (value);
there is no original struct to go back to and there can be another
struct
typedef struct iterator_stack_2
{
struct iterator_stack_2 *prev;
mpz_t value;
int foo;
} iterator_stack_2;
iterator_stack_2 x;
..
bar (x.value);
What does bar get back to? Are you saying if a pointer is passed to bar,
it can get back to any original struct where the pointer is a field?
--
hjl at lucon dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|RESOLVED |UNCONFIRMED
Resolution|INVALID |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33279