This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/44386] builtin_object_size_ assumes a flexible array for a long array in a structure of known length
- From: "meklund at cisco dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 7 Jun 2010 15:26:22 -0000
- Subject: [Bug middle-end/44386] builtin_object_size_ assumes a flexible array for a long array in a structure of known length
- References: <bug-44386-11981@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #4 from meklund at cisco dot com 2010-06-07 15:26 -------
I see your point that some legacy code might use a larger size as a flexible
array.
What is you opinion on the possibility of adding a bit-flag to
__builtin_object_size() (like 0x04) that tightens the allowed flexible array
size to be only 0 or 1? Larger sizes would be accepted as the total array
size. This would be closer to that in
http://gcc.gnu.org/onlinedocs/gcc-4.5.0/gcc/Zero-Length.html#Zero-Length.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44386