Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(72)

Issue 4641041: Rework the sizeof / memset warning.

Can't Edit
Can't Publish+Mail
Start Review
Created:
14 years, 7 months ago by chandlerc
Modified:
14 years, 7 months ago
Reviewers:
nlewycky1
Visibility:
Public.

Patch Set 1 #

Total comments: 6
Unified diffs Side-by-side diffs Delta from patch set Stats (+88 lines, -32 lines) Patch
M include/clang/Basic/DiagnosticSemaKinds.td View 1 chunk +9 lines, -3 lines 0 comments Download
M lib/Sema/SemaChecking.cpp View 3 chunks +69 lines, -22 lines 6 comments Download
M test/SemaCXX/warn-memset-bad-sizeof.cpp View 1 chunk +10 lines, -7 lines 0 comments Download

Messages

Total messages: 2
nlewycky1
Looks fine, minor comments. http://codereview.appspot.com/4641041/diff/1/lib/Sema/SemaChecking.cpp File lib/Sema/SemaChecking.cpp (right): http://codereview.appspot.com/4641041/diff/1/lib/Sema/SemaChecking.cpp#newcode1831 lib/Sema/SemaChecking.cpp:1831: /// \brief If E is ...
14 years, 7 months ago (2011-06-16 16:53:00 UTC) #1
chandlerc
14 years, 6 months ago (2011-06-21 22:34:56 UTC) #2
Thanks for the review!

http://codereview.appspot.com/4641041/diff/1/lib/Sema/SemaChecking.cpp
File lib/Sema/SemaChecking.cpp (right):

http://codereview.appspot.com/4641041/diff/1/lib/Sema/SemaChecking.cpp#newcod...
lib/Sema/SemaChecking.cpp:1831: /// \brief If E is a sizeof expression returns
the argument expression,
On 2011/06/16 16:53:00, nlewycky1 wrote:
> returns *its argument expression

Done.

http://codereview.appspot.com/4641041/diff/1/lib/Sema/SemaChecking.cpp#newcod...
lib/Sema/SemaChecking.cpp:1837: return
SizeOf->getArgumentExpr()->IgnoreParenImpCasts();
On 2011/06/16 16:53:00, nlewycky1 wrote:
> Why the IgnoreParenImpCasts()?

sizeof ((((x))))

Seemed nice not need every caller to do this. I could potentially not strip imp
casts, i can't conceive of a way they would be present in the AST within a
sizeof argument (as it would kinda defeat the purpose...) but I was mirroring
the logic applied to the src/dest argument in these functions.

http://codereview.appspot.com/4641041/diff/1/lib/Sema/SemaChecking.cpp#newcod...
lib/Sema/SemaChecking.cpp:1842: /// \brief If E is a sizeof expression returns
the argument type.
On 2011/06/16 16:53:00, nlewycky1 wrote:
> s/the/its/ again

Done.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b