Re: [PATCH] D24238: StaticAnalyzer CastToStruct : No memory corruption when casting array to struct

2016-09-12 Thread Artem Dergachev via cfe-commits
NoQ added a comment. Random thoughts: - This checker doesn't alter the exploded graph, so it cannot be causing or suppressing positives in other checkers. - We should not be adding platform-specific behavior (eg. working as if `sizeof(int) == 1`) without actually ensuring that it is so on

Re: [PATCH] D24238: StaticAnalyzer CastToStruct : No memory corruption when casting array to struct

2016-09-12 Thread Daniel Marjamäki via cfe-commits
danielmarjamaki abandoned this revision. danielmarjamaki added a comment. hmm.. I don't actually care much about this specific check at the moment. I saw other false positives (unreachable code) and thought that this check made the analyzer think there was corrupted memory. Now I can't

Re: [PATCH] D24238: StaticAnalyzer CastToStruct : No memory corruption when casting array to struct

2016-09-12 Thread Daniel Marjamäki via cfe-commits
danielmarjamaki added a comment. If the -fno-strict-aliasing would fix this warning then it would be OK. If you are telling me that this CastToStruct check is about alignment or endianness then I think the message is highly misleading. We should rewrite the message. In general, using char

Re: [PATCH] D24238: StaticAnalyzer CastToStruct : No memory corruption when casting array to struct

2016-09-09 Thread Artem Dergachev via cfe-commits
NoQ added a subscriber: cfe-commits. NoQ added a comment. Adding cfe-commits as per developer policy. Yeah, it doesn't probably cause the same kind of memory corruption, however i wouldn't call this code safe: it still violates the //strict aliasing rule//, unless the array is of `char`s. I