static analyzer false positive? (when reinterpreting buffer as char*)

Hi all,

Consider:

Yes, it is.

-Eli

Yes it is a false positive. The analyzer doesn't handle well dealing with re-interpretation casts of arrays like this. While we don't have a good way to reason about this now, it should be straightforward to suppress the false positive.

Please file a PR.

Thanks Eli and Ted for the fast responses. Bugs:
<http://llvm.org/bugs/show_bug.cgi?id=13919>
<rdar://problem/12370655>

Cheers,

Hm. Yes, it's a false positive, and we do have outstanding bugs for not handling type-punning well. PR7913 has a similar case, along with a handful of Radars.

Meanwhile, one way to avoid the false positive is by using a union.

Sorry for the inconvenience!
Jordan