cfe-dev Digest, Vol 49, Issue 106

Peter,
Chandler,
hopefully I can add something without “throwing gas on the fire”.!.

if you believe that most array bounds violations are dynamic (can’t be caught
at compile time, would require run-time bounds checking code), then it would
seem that being pedantic about static - size - ‘1’ arrays that are the last field
of a struct (a “standard” coding practice for a long long time) is mis-placed
effort, and detecting them with a static analyzer is giving people a false sense
of security where none is warranted.

-Peter Lawrence.

Thank you Peter, but the issue has been resolved as of r136724. I am
very happy with the outcome.

Really? Was it my patch or something else?

Nicola

Thank you Peter, but the issue has been resolved as of r136724. I am
very happy with the outcome.

Really? Was it my patch or something else?

I think Chris just pulled rank, as it were, and checked in the basic
fix (without any c99 variation or narrowing of cases down to single
element arrays from constants at the end of structs, etc):
http://llvm.org/viewvc/llvm-project?view=rev&revision=136724

- David

FYI, I’ve finished implementing the logic requested in r136965. Sorry for the delays. This should be similar to your logic Nicola, but I had to re-write several parts of your patch to get it all working. Thanks for contributing the fundamentals though! Let me know if you have any questions about how it turned out.