r200980 - [analyzer] Just silence all warnings coming out of std::basic_string.

Jordan Rose jordan_rose at apple.com
Mon Feb 10 09:50:15 PST 2014


On Feb 9, 2014, at 0:08 , David Blaikie <dblaikie at gmail.com> wrote:

> [analyzer] Just silence all warnings coming out of std::basic_string.
> 
> This does seem like a rather rough heuristic - is there nothing better? (more general - everything in the STL? What about every other string class everyone and their monkey have written? And I assume this isn't about strings, as such, but just a complexity problem with complex types and string just happens to be a commonly used one?) 


I know...these are all arguments I've made to Anna in resisting these sorts of changes, and now I'm the one making them.

The particular problem with basic_string is in the short string / long string implementation; we've had repeated cases where the analyzer thinks there's a delete of stack memory or use-after-free. If we put more effort into union support (quite a bit, most likely), it would help a lot. (We may need better bitwise support as well.)

It's possible a better heuristic would be to squelch warnings coming from classes that looks like containers, but that doesn't help if you're implementing a container class.

But yes, this is an unfortunately reactionary change. I'm not happy with it either, but it seems better than false positives, and std::string variants have accounted for quite a few of the reported bugs in the analyzer's C++ support.

Jordan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140210/f8cfc831/attachment.html>


More information about the cfe-commits mailing list