This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug middle-end/33279] Failed to warn uninitialized stack variable



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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]