https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109201

--- Comment #1 from David Malcolm <dmalcolm at gcc dot gnu.org> ---
The division by zero warning on:
   if ((d.b = 1) / 0)
is from -Wdiv-by-zero, which isn't from the analyzer (
https://godbolt.org/z/433PhKhvM )

The analyzer currently only implements -Wanalyzer-tainted-divisor for
attacker-controlled values used in division; it doesn't check for zero itself.

So this seems like more of an RFE: it sounds like you'd want the analyzer to
complain about known zero values reaching a division, as a souped-up kind
implementation of the existing -Wdiv-by-zero.

Reply via email to