When reading an individual byte from a larger value, the static analyzer is fine if:
a) reading any byte if the source is a uint32_t
b) reading the first byte if the source is a uint32_t[1]
But it falsely reports a problem if reading a subsequent byte from uint32_t[1]
The attached test case demonstrates good (silent) behaviour with VARIANT= 1, 2 and 3. And exposes the false positive with VARIANT=4.
I also tested with clang-3.7 and clang-3.6, so it's not a regression.
Extended Description
When reading an individual byte from a larger value, the static analyzer is fine if: a) reading any byte if the source is a uint32_t b) reading the first byte if the source is a uint32_t[1]
But it falsely reports a problem if reading a subsequent byte from uint32_t[1]
The attached test case demonstrates good (silent) behaviour with VARIANT= 1, 2 and 3. And exposes the false positive with VARIANT=4.
I also tested with clang-3.7 and clang-3.6, so it's not a regression.