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 other/52944] [4.5/4.6 Regression] __builtin_object_size(..., 1) no longer returns (size_t)-1 for consecutive flexible/zero-length array members


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.


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