diff options
author | Hans Wennborg <hans@hanshq.net> | 2012-03-09 10:10:54 +0000 |
---|---|---|
committer | Hans Wennborg <hans@hanshq.net> | 2012-03-09 10:10:54 +0000 |
commit | aa8c61cf94b75946087799fad85e23ac38e8b18f (patch) | |
tree | 8f84e59a50c07d899bc45ad363f1764565f898c2 /clang/lib/Analysis/FormatString.cpp | |
parent | 29e9595bd783b032c96f60a8602bb2b7d136e735 (diff) | |
download | bcm5719-llvm-aa8c61cf94b75946087799fad85e23ac38e8b18f.tar.gz bcm5719-llvm-aa8c61cf94b75946087799fad85e23ac38e8b18f.zip |
-Wformat-non-iso: warn about positional arguments (pr12017)
This renames the -Wformat-non-standard flag to -Wformat-non-iso,
rewords the current warnings a bit (pointing out that a format string
is not supported by ISO C rather than being "non standard"),
and adds a warning about positional arguments.
llvm-svn: 152403
Diffstat (limited to 'clang/lib/Analysis/FormatString.cpp')
-rw-r--r-- | clang/lib/Analysis/FormatString.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/lib/Analysis/FormatString.cpp b/clang/lib/Analysis/FormatString.cpp index 5785655c946..dd2f2406d46 100644 --- a/clang/lib/Analysis/FormatString.cpp +++ b/clang/lib/Analysis/FormatString.cpp @@ -156,6 +156,9 @@ clang::analyze_format_string::ParseArgPosition(FormatStringHandler &H, } if (Amt.getHowSpecified() == OptionalAmount::Constant && *(I++) == '$') { + // Warn that positional arguments are non-standard. + H.HandlePosition(Start, I - Start); + // Special case: '%0$', since this is an easy mistake. if (Amt.getConstantAmount() == 0) { H.HandleZeroPosition(Start, I - Start); |