> > This brings out 2 questions. Why don't GCC 4.4/4.6/4.7 warn it? > > Why doesn't 64bit GCC 4.2 warn it?
> Good question. It seems that the difference is whether the compiler > generates a field-by-field copy or a call to memcpy(). According to > David, the trunk gcc in 32-bit mode doesn't call memcpy, but still > doesn't warn. He's looking at it. Is this related to this bug, which I filed a year or two ago? http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42561 It would indeed be very nice to get this taken care of, as this kind of analysis would really help find a lot of bugs that currently require commercial tools.