[cfe-commits] r108542 - in /cfe/trunk: include/clang/Basic/DiagnosticSemaKinds.td lib/Analysis/ScanfFormatString.cpp lib/Sema/SemaChecking.cpp test/Sema/format-strings-scanf.c

Chris Lattner clattner at apple.com
Fri Jul 16 13:08:58 PDT 2010


On Jul 16, 2010, at 11:28 AM, Ted Kremenek wrote:

> Author: kremenek
> Date: Fri Jul 16 13:28:03 2010
> New Revision: 108542
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=108542&view=rev
> Log:
> Hook up warning for an incomplete scanlist in scanf format strings.

Hey Ted,

> @@ -2985,7 +2985,7 @@
>   "flag '%0' is ignored when flag '%1' is present">,
>   InGroup<Format>;
> def warn_scanf_scanlist_incomplete : Warning<
> -  "scanlist not terminated in format string">,
> +  "no closing ‘]’ for ‘%%[’ in scanf format string">,

You've got a crazy unicode thing going on here?

> 
>   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}}
> +  scanf("%d%[asdfasdfd", i, s); // expected-warning{{no closing ‘]’ for ‘%[’ in scanf format string}}

And here?

-Chris





More information about the cfe-commits mailing list