[Bug other/52944] [4.5/4.6 Regression] __builtin_object_size(..., 1) no longer returns (size_t)-1 for consecutive flexible/zero-length array members
rguenth at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Thu Apr 12 09:21:00 GMT 2012
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52944
Richard Guenther <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |WONTFIX
--- Comment #1 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-04-12 09:20:37 UTC ---
It works as expected. buf[] is not made magically flexible by tail[]. Why
does the code not simply use
struct stct {
int i;
union {
short k;
char buf[0];
};
};
?
Btw, With GCC 4.7 you get 96 ... which is similar conservative as -1.
But zero is certainly correct and expected.
More information about the Gcc-bugs
mailing list