Author: andyg
Date: Tue Apr 5 03:36:47 2016
New Revision: 265381
URL: http://llvm.org/viewvc/llvm-project?rev=265381&view=rev
Log:
Consolidate and improve the handling of built-in feature-like macros
Summary:
The parsing logic has been separated out from the macro implementation logic,
leading
This revision was automatically updated to reflect the committed changes.
Closed by commit rL265381: Consolidate and improve the handling of built-in
feature-like macros (authored by AndyG).
Changed prior to commit:
http://reviews.llvm.org/D17149?vs=52535&id=52664#toc
Repository:
rL LLVM
ht
AndyG updated this revision to Diff 52535.
AndyG marked 5 inline comments as done.
AndyG added a comment.
Implemented comments.
http://reviews.llvm.org/D17149
Files:
include/clang/Basic/DiagnosticLexKinds.td
lib/Lex/PPMacroExpansion.cpp
test/Preprocessor/feature_tests.c
test/Preprocesso
AndyG added inline comments.
Comment at: lib/Lex/PPMacroExpansion.cpp:1456-1457
@@ +1455,4 @@
+
+// Parse next non-comment, non-annotation token.
+do PP.LexUnexpandedNonComment(Tok); while (Tok.isAnnotation());
+
rsmith wrote:
> If we get an annotation tok
AndyG updated this revision to Diff 52513.
AndyG added a comment.
Ok, I've removed support for nested parentheses. Can this go through now?
Thanks.
http://reviews.llvm.org/D17149
Files:
include/clang/Basic/DiagnosticLexKinds.td
lib/Lex/PPMacroExpansion.cpp
test/Preprocessor/feature_test
Author: andyg
Date: Fri Apr 1 14:02:20 2016
New Revision: 265177
URL: http://llvm.org/viewvc/llvm-project?rev=265177&view=rev
Log:
Diagnose missing macro argument following charize operator.
For completeness, add a test-case for the equivalent stringize operator
diagnostic too.
Modified:
cf
Author: andyg
Date: Fri Feb 26 09:35:16 2016
New Revision: 262025
URL: http://llvm.org/viewvc/llvm-project?rev=262025&view=rev
Log:
Reduce false positives in printf/scanf format checker
Summary:
The printf/scanf format checker is a little over-zealous in handling the
conditional operator. This
AndyG added inline comments.
Comment at: lib/Sema/SemaChecking.cpp:3923-3924
@@ +3922,4 @@
+ PartialDiagnostic PDiag = S.PDiag(diag::warn_printf_data_arg_not_used);
+ for (unsigned i = 1; i < DiagnosticExprs.size(); ++i)
+PDiag << DiagnosticExprs[i]->getSourceRange();
+
AndyG updated this revision to Diff 49058.
AndyG marked 5 inline comments as done.
AndyG added a comment.
Updated patch according to the comments made. Also spotted a corner-case where
a double-diagnostic was produced, for example in the following where one string
has too few arguments and the
AndyG added a comment.
Second bump :o)
http://reviews.llvm.org/D17149
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
AndyG added inline comments.
Comment at: lib/Sema/SemaChecking.cpp:3905
@@ -3822,14 +3904,3 @@
CoveredArgs.flip();
-signed notCoveredArg = CoveredArgs.find_first();
-if (notCoveredArg >= 0) {
- assert((unsigned)notCoveredArg < NumDataArgs);
- if (const Expr
AndyG updated this revision to Diff 48678.
AndyG marked 2 inline comments as done.
AndyG added a comment.
Patch additionally re-based off r261522.
http://reviews.llvm.org/D15636
Files:
lib/Sema/SemaChecking.cpp
test/Sema/format-strings-scanf.c
test/Sema/format-strings.c
Index: test/Sema/
AndyG marked 11 inline comments as done.
AndyG added a comment.
Revised patch coming shortly...
Comment at: lib/Sema/SemaChecking.cpp:3603
@@ -3554,3 +3602,3 @@
- void DoneProcessing();
+ void DoneProcessing(signed &FirstUncoveredArg);
rtrieu wrote:
> Don'
AndyG marked 7 inline comments as done.
AndyG added a comment.
I've removed CheckFormatString from Sema.h and make it a static function inside
SemaChecking.cpp in r261522. I'll submit a new diff here with the remaining
requested changes for this patch when I have a moment.
http://reviews.llvm
Author: andyg
Date: Mon Feb 22 07:00:43 2016
New Revision: 261522
URL: http://llvm.org/viewvc/llvm-project?rev=261522&view=rev
Log:
Make Sema::CheckFormatString a static function inside SemaChecking.cpp
No functionality change. Change at the request of Richard Trieu, see
http://reviews.llvm.org/
AndyG added a comment.
Bump :o)
http://reviews.llvm.org/D17149
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
AndyG added a comment.
Richard, are you happy with this latest version? Can I proceed to commit it?
Thanks.
http://reviews.llvm.org/D15636
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-c
AndyG added a comment.
To be honest, the simple answer is because it was just as easy to do with
nesting as without (the code would still need to track the appearance of left
and right parentheses in order to correctly parse to the closing
right-parenthesis of the macro invocation in any case).
AndyG added a comment.
Test comment -- just to see whether email notifications are sending properly
(it seems, for example, that cfe-commits wasn't notified of this patch...)
http://reviews.llvm.org/D17149
___
cfe-commits mailing list
cfe-commits@l
AndyG removed reviewers: dblaikie, rsmith.
AndyG updated this revision to Diff 47426.
AndyG added a comment.
All strings matching the highest uncovered argument are now highlighted in the
diagnostic.
http://reviews.llvm.org/D15636
Files:
include/clang/Sema/Sema.h
lib/Sema/SemaChecking.cpp
AndyG added a comment.
In your case, the first string would be highlighted only. Yes, I see what you
mean. Is it possible to have multiple ranges for the diagnostic? By which I
mean, to produce the following:
test.cpp:x:y: warning: data argument not used by format string
[-Wformat-extra-a
AndyG added a comment.
Thoughts? Am I good to go?
Cheers,
Andy
http://reviews.llvm.org/D15636
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
AndyG added a comment.
Yes, but only for the "data argument not used" warning. All other warnings are
unaffected by the change, for example:
test.cpp:9:51: warning: format specifies type 'char *' but the argument has
type 'int' [-Wformat]
AndyG added a comment.
Hi Richard,
Thank you for looking at my patch. I would argue that the code
printf(minimal ? "%i\n" : "%i: %s\n", code, msg);
is valid and should //not// cause a warning due to unused arguments since at
least one code path uses all the arguments. This in my view is th
AndyG added a reviewer: rtrieu.
AndyG added a comment.
Richard, you have been recommended to me as a suitable reviewer by David. If
that's not ok with you, please could you recommend another! Thanks, Andy.
http://reviews.llvm.org/D15636
___
cfe-c
AndyG added a comment.
Bump! :o)
http://reviews.llvm.org/D15636
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
AndyG added a comment.
Richard, David,
Sorry, I've added you as reviewers by proximity to recent relevant changes in
SemaChecking.cpp. Hope you don't mind. Please tell me who to redirect to, if
there are more applicable reviewers.
Cheers
Andy
http://reviews.llvm.org/D15636
_
AndyG created this revision.
AndyG added a reviewer: cfe-commits.
The printf/scanf format checker is a little over-zealous in handling the
conditional operator. This patch reduces work by not checking code-paths that
are never used and reduces false positives regarding uncovered arguments, for
28 matches
Mail list logo