[PATCH] D33672: [analyzer] INT50-CPP. Do not cast to an out-of-range enumeration checker

Artem Dergachev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jul 24 11:59:08 PDT 2017


NoQ added a comment.

Did the checker flag any intentionally underpopulated enums, eg.

  enum {
    Unset = -1
  } NumberOfChickens = 15;

(such code is bad, but it is not necessarily buggy - as far as i understand from the CERT rule, we're talking about "unspecified behavior" which some implementations may define and document, and then some people may rely)?

Are you sure this checker isn't useful for C?


https://reviews.llvm.org/D33672





More information about the cfe-commits mailing list