[cfe-commits] r108541 - in /cfe/trunk: include/clang/Basic/DiagnosticSemaKinds.td test/Sema/format-strings-scanf.c
Ted Kremenek
kremenek at apple.com
Fri Jul 16 11:27:56 PDT 2010
Author: kremenek
Date: Fri Jul 16 13:27:56 2010
New Revision: 108541
URL: http://llvm.org/viewvc/llvm-project?rev=108541&view=rev
Log:
Tweak zero-field width in scanf format string diagnostic.
Modified:
cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td
cfe/trunk/test/Sema/format-strings-scanf.c
Modified: cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td?rev=108541&r1=108540&r2=108541&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td (original)
+++ cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td Fri Jul 16 13:27:56 2010
@@ -2941,7 +2941,7 @@
def warn_missing_format_string : Warning<
"format string missing">, InGroup<Format>;
def warn_scanf_nonzero_width : Warning<
- "conversion specifies 0 input characters for field width">,
+ "zero field width in scanf format string is unused">,
InGroup<Format>;
def warn_printf_conversion_argument_type_mismatch : Warning<
"conversion specifies type %0 but the argument has type %1">,
@@ -2984,6 +2984,9 @@
def warn_printf_ignored_flag: Warning<
"flag '%0' is ignored when flag '%1' is present">,
InGroup<Format>;
+def warn_scanf_scanlist_incomplete : Warning<
+ "scanlist not terminated in format string">,
+ InGroup<Format>;
// CHECK: returning address/reference of stack memory
def warn_ret_stack_addr : Warning<
Modified: cfe/trunk/test/Sema/format-strings-scanf.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/format-strings-scanf.c?rev=108541&r1=108540&r2=108541&view=diff
==============================================================================
--- cfe/trunk/test/Sema/format-strings-scanf.c (original)
+++ cfe/trunk/test/Sema/format-strings-scanf.c Fri Jul 16 13:27:56 2010
@@ -9,6 +9,6 @@
void test(const char *s, int *i) {
scanf(s, i); // expected-warning{{ormat string is not a string literal}}
- scanf("%0d", i); // expected-warning{{conversion specifies 0 input characters for field width}}
- scanf("%00d", i); // expected-warning{{conversion specifies 0 input characters for field width}}
+ scanf("%0d", i); // expected-warning{{zero field width in scanf format string is unused}}
+ scanf("%00d", i); // expected-warning{{zero field width in scanf format string is unused}}
}
More information about the cfe-commits
mailing list