diff options
author | Hans Wennborg <hans@hanshq.net> | 2011-10-18 08:10:06 +0000 |
---|---|---|
committer | Hans Wennborg <hans@hanshq.net> | 2011-10-18 08:10:06 +0000 |
commit | f99d04f841bc2fddd009b6481f43c266cabf4300 (patch) | |
tree | c043ee09ca376782e8982967dbeba0d3605c8ad8 /clang/lib/Sema/SemaChecking.cpp | |
parent | 2b7a1ff77fc36f79cd7b40944a4267ee83934a7e (diff) | |
download | bcm5719-llvm-f99d04f841bc2fddd009b6481f43c266cabf4300.tar.gz bcm5719-llvm-f99d04f841bc2fddd009b6481f43c266cabf4300.zip |
Suggest %zu for size_t args to printf.
For PR11152. Make PrintSpecifier::fixType() suggest "%zu" for size_t, etc.
rather than looking at the underlying type and suggesting "%llu" or other
platform-specific length modifiers. Applies to C99 and C++11.
llvm-svn: 142342
Diffstat (limited to 'clang/lib/Sema/SemaChecking.cpp')
-rw-r--r-- | clang/lib/Sema/SemaChecking.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaChecking.cpp b/clang/lib/Sema/SemaChecking.cpp index 329adf89e8a..fd99528bd68 100644 --- a/clang/lib/Sema/SemaChecking.cpp +++ b/clang/lib/Sema/SemaChecking.cpp @@ -1966,7 +1966,7 @@ CheckPrintfHandler::HandlePrintfSpecifier(const analyze_printf::PrintfSpecifier // We may be able to offer a FixItHint if it is a supported type. PrintfSpecifier fixedFS = FS; - bool success = fixedFS.fixType(Ex->getType()); + bool success = fixedFS.fixType(Ex->getType(), S.getLangOptions()); if (success) { // Get the fix string from the fixed format specifier |