https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105783
David Malcolm <dmalcolm at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |ASSIGNED
Ever confirmed|0 |1
Last reconfirmed| |2022-10-06
--- Comment #1 from David Malcolm <dmalcolm at gcc dot gnu.org> ---
Thanks for filing this bug.
Confirmed with trunk.
Adding:
__analyzer_describe (0, t->counting);
immediately before the conditional shows we have:
<source>:16:5: warning: svalue: 'CAST(int, BITS_WITHIN('_Bool', start: 0, size:
1, next: 1, inner_val: (unsigned char)1))'
16 | __analyzer_describe (0, t->counting);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
so presumably the analyzer isn't smart enough to determine that that's nonzero.
Note to self: MCVE is Stack Overflow's acronym for a "minimal, complete and
verifiable example"
(https://stackoverflow.com/help/minimal-reproducible-example)