lebedev.ri added inline comments.

================
Comment at: cfe/trunk/test/Sema/tautological-constant-compare.c:23
+
+  if (c > macro(255))
+      return;
----------------
I'm having second thoughts about macro handling.
Right now we completely ignore the comparisons when the constant is anyhow 
involved with macros.
I.e.
```
unsigned char c;
if (c > 255) // expected-warning {{comparison 'unsigned char' > 255 is always 
false}}
  return;  // would be diagnosed correctly
// but
assert (c <= 255); // would be completely ignored.
```
Perhaps we should be a bit more strict, and should not bailout in such cases?

But i *guess* this case we still should ignore
```
#define macro(val) (val > 255)
if (macro(c))
  return;
```

(Even though gcc warns in the last variant too)


Repository:
  rL LLVM

https://reviews.llvm.org/D38101



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
  • [PATCH] D3... Roman Lebedev via Phabricator via cfe-commits
  • [PATCH] D3... Richard Smith - zygoloid via Phabricator via cfe-commits
  • [PATCH] D3... Roman Lebedev via Phabricator via cfe-commits
  • [PATCH] D3... Roman Lebedev via Phabricator via cfe-commits
  • [PATCH] D3... Roman Lebedev via Phabricator via cfe-commits
  • [PATCH] D3... Phabricator via Phabricator via cfe-commits
  • [PATCH] D3... Roman Lebedev via Phabricator via cfe-commits
    • Re: [... Richard Smith via cfe-commits
      • R... Roman Lebedev via cfe-commits
        • ... Richard Smith via cfe-commits
  • [PATCH] D3... Roman Lebedev via Phabricator via cfe-commits
  • [PATCH] D3... Roman Lebedev via Phabricator via cfe-commits
  • [PATCH] D3... Phabricator via Phabricator via cfe-commits
  • [PATCH] D3... mattias.v.eriks...@ericsson.com via Phabricator via cfe-commits
  • [PATCH] D3... Roman Lebedev via Phabricator via cfe-commits
  • [PATCH] D3... mattias.v.eriks...@ericsson.com via Phabricator via cfe-commits

Reply via email to