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

Hi all,


Yes, it is.


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:


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!