[Bug tree-optimization/43270] array-bounds false negative

matt at use dot net gcc-bugzilla@gcc.gnu.org
Sat Mar 6 00:19:00 GMT 2010



------- Comment #9 from matt at use dot net  2010-03-06 00:18 -------
Alright. Even though PC-Lint now correctly warns, and GCC still does not, I
have updated the attached example yet again to avoid the next constraint you
mention.

GCC still does not detect the array-bounds issue, even when the array whose
bound is being violated it is neither the first nor the last field in the
struct/class. I tried using primitive types, complex types, references/pointer,
and arrays for the fields in question. GCC still never detects the issue.

Even for existing code that uses this pattern for flexible array members, a
private array that has not been otherwise initialized in the ctor, which is
accessed out of bounds in said ctor, seems unlikely. Perhaps I will enter that
as a separate bug, but I hope that this latest code example (which still
decently matches the real code I had the bug with) is worthy of the bug being
detected.


-- 

matt at use dot net changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |UNCONFIRMED
         Resolution|WONTFIX                     |


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



More information about the Gcc-bugs mailing list