[llvm-branch-commits] [cfe-branch] r120664 - in /cfe/branches/Apple/whitney: lib/Analysis/PrintfFormatString.cpp test/Sema/format-strings.c
Daniel Dunbar
daniel at zuster.org
Wed Dec 1 18:52:11 PST 2010
Author: ddunbar
Date: Wed Dec 1 20:52:11 2010
New Revision: 120664
URL: http://llvm.org/viewvc/llvm-project?rev=120664&view=rev
Log:
Merge r119946:
--
Author: Anders Carlsson <andersca at mac.com>
Date: Sun Nov 21 18:34:21 2010 +0000
The 'X' printf type has a valid alternative form. Fixes PR8641.
Modified:
cfe/branches/Apple/whitney/lib/Analysis/PrintfFormatString.cpp
cfe/branches/Apple/whitney/test/Sema/format-strings.c
Modified: cfe/branches/Apple/whitney/lib/Analysis/PrintfFormatString.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/Apple/whitney/lib/Analysis/PrintfFormatString.cpp?rev=120664&r1=120663&r2=120664&view=diff
==============================================================================
--- cfe/branches/Apple/whitney/lib/Analysis/PrintfFormatString.cpp (original)
+++ cfe/branches/Apple/whitney/lib/Analysis/PrintfFormatString.cpp Wed Dec 1 20:52:11 2010
@@ -501,10 +501,11 @@
if (!HasAlternativeForm)
return true;
- // Alternate form flag only valid with the oxaAeEfFgG conversions
+ // Alternate form flag only valid with the oxXaAeEfFgG conversions
switch (CS.getKind()) {
case ConversionSpecifier::oArg:
case ConversionSpecifier::xArg:
+ case ConversionSpecifier::XArg:
case ConversionSpecifier::aArg:
case ConversionSpecifier::AArg:
case ConversionSpecifier::eArg:
Modified: cfe/branches/Apple/whitney/test/Sema/format-strings.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/Apple/whitney/test/Sema/format-strings.c?rev=120664&r1=120663&r2=120664&view=diff
==============================================================================
--- cfe/branches/Apple/whitney/test/Sema/format-strings.c (original)
+++ cfe/branches/Apple/whitney/test/Sema/format-strings.c Wed Dec 1 20:52:11 2010
@@ -325,3 +325,8 @@
rdar8332221_vprintf_scanf("%", ap, "%d", x); // expected-warning{{incomplete format specifier}}
}
+// PR8641
+void pr8641() {
+ printf("%#x\n", 10);
+ printf("%#X\n", 10);
+}
More information about the llvm-branch-commits
mailing list