summaryrefslogtreecommitdiffstats
path: root/clang/lib/Analysis/FormatString.cpp
diff options
context:
space:
mode:
authorHans Wennborg <hans@hanshq.net>2012-03-09 10:10:54 +0000
committerHans Wennborg <hans@hanshq.net>2012-03-09 10:10:54 +0000
commitaa8c61cf94b75946087799fad85e23ac38e8b18f (patch)
tree8f84e59a50c07d899bc45ad363f1764565f898c2 /clang/lib/Analysis/FormatString.cpp
parent29e9595bd783b032c96f60a8602bb2b7d136e735 (diff)
downloadbcm5719-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.cpp3
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);
OpenPOWER on IntegriCloud