[PATCH] D40463: [analyzer] Fix false negative on post-increment of uninitialized variable.
Roman Lebedev via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Nov 29 10:33:16 PST 2017
lebedev.ri added inline comments.
================
Comment at: lib/StaticAnalyzer/Checkers/UndefinedAssignmentChecker.cpp:64
+ if (const UnaryOperator *U = dyn_cast<UnaryOperator>(StoreE)) {
+ str = "The expression of the unary operator is an uninitialized value. "
+ "The computed value will also be garbage";
----------------
xazax.hun wrote:
> lebedev.ri wrote:
> > dcoughlin wrote:
> > > "Unary operator" is probably not something we should expect users to know about. How about just "The expression is an uninitialized value. The computed value will also be garbage."
> > >
> > Yep, i did not like my wording either :)
> A value being undefined does nt mean uninitialized. E.g.: the result of a bad shift operation might be UndefVal as well.
> Aren't these diagnostics misleading in those cases? Or we do not care about those?
I think this is for @dcoughlin to answer.
But shift operation is a binary operator, so this diff should not change that.
Repository:
rC Clang
https://reviews.llvm.org/D40463
More information about the cfe-commits
mailing list