[Bug middle-end/30086] Initialize struct to avoid warnings shouldn't be needed

pinskia at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Wed Dec 6 23:14:00 GMT 2006



------- Comment #1 from pinskia at gcc dot gnu dot org  2006-12-06 23:14 -------
Depends how the source looks, it might be actually used uninitialized which
means the code is undefined anyways.
Can you attach the preprocessed source?

I have seen stuff like:

struct a{int t; int t1};

void f(struct a);

void g(void)
{
  struct a b;
  b.t = 1;
  f(b);
}
(maybe a little more complex but you get the idea).
How does GCC know that not all the elements of b are not used.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|c                           |middle-end


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



More information about the Gcc-bugs mailing list