[PATCH] D59121: [analyzer] Fix macro names in diagnostics within bigger macros.

Artem Dergachev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Mar 29 14:49:19 PDT 2019


NoQ updated this revision to Diff 192917.
NoQ added a comment.

Also, this is kinda weird. According to my logic, we should have written `Assuming 'i' is equal to 4294967295` because that's what the user will see in the macro popup. However, that's incorrect for the same reason: `i` is an int, while `4294967295` doesn't fit into an int, so they can never be equal. Writing `Assuming 'i' is equal to UINT32_MAX` is incorrect for the same reason, and the current message is the only one that's technically the truth.

Writing what exactly we're assuming is, in my opinion, more important than repeating what's literally written in the code.

Added a FIXME test to document this problem.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D59121/new/

https://reviews.llvm.org/D59121

Files:
  clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp
  clang/test/Analysis/diagnostics/macros.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D59121.192917.patch
Type: text/x-patch
Size: 5001 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190329/bad06b5e/attachment-0001.bin>


More information about the cfe-commits mailing list