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 | a7da2155167676a6a5d9fca4de947a9cab2a4908 (patch) | |
tree | 1e5ced027704a0e259308c93748e10eace432346 /lib/Sema/SemaChecking.cpp | |
parent | 5f31f0893d75203c326ddcd9808099bbfe34aec0 (diff) |
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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142342 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaChecking.cpp')
-rw-r--r-- | lib/Sema/SemaChecking.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Sema/SemaChecking.cpp b/lib/Sema/SemaChecking.cpp index 329adf89e8..fd99528bd6 100644 --- a/lib/Sema/SemaChecking.cpp +++ b/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 |