diff options
author | Hans Wennborg <hans@hanshq.net> | 2011-12-07 10:33:11 +0000 |
---|---|---|
committer | Hans Wennborg <hans@hanshq.net> | 2011-12-07 10:33:11 +0000 |
commit | 772e9270f666afef722292b6aaf3791feb8fcc1f (patch) | |
tree | e457b5a164801eb7e81c3a5d014b11f463126556 /clang/lib/Sema/SemaChecking.cpp | |
parent | 1d578e8835282f5aac1d2fef3801e38c7a8fc870 (diff) | |
download | bcm5719-llvm-772e9270f666afef722292b6aaf3791feb8fcc1f.tar.gz bcm5719-llvm-772e9270f666afef722292b6aaf3791feb8fcc1f.zip |
Make printf warnings refer to intmax_t et al. by name
in addition to underlying type.
For example, the warning for printf("%zu", 42.0);
changes from "conversion specifies type 'unsigned long'" to "conversion
specifies type 'size_t' (aka 'unsigned long')"
(This is a second attempt after r145697, which got reverted.)
llvm-svn: 146032
Diffstat (limited to 'clang/lib/Sema/SemaChecking.cpp')
-rw-r--r-- | clang/lib/Sema/SemaChecking.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/clang/lib/Sema/SemaChecking.cpp b/clang/lib/Sema/SemaChecking.cpp index 869922faf42..f635afcc306 100644 --- a/clang/lib/Sema/SemaChecking.cpp +++ b/clang/lib/Sema/SemaChecking.cpp @@ -2014,7 +2014,7 @@ bool CheckPrintfHandler::HandleAmount( if (!ATR.matchesType(S.Context, T)) { EmitFormatDiagnostic(S.PDiag(diag::warn_printf_asterisk_wrong_type) - << k << ATR.getRepresentativeType(S.Context) + << k << ATR.getRepresentativeTypeName(S.Context) << T << Arg->getSourceRange(), getLocationOfByte(Amt.getStart()), /*IsStringLocation*/true, @@ -2234,7 +2234,7 @@ CheckPrintfHandler::HandlePrintfSpecifier(const analyze_printf::PrintfSpecifier // type is 'wint_t' (which is defined in the system headers). EmitFormatDiagnostic( S.PDiag(diag::warn_printf_conversion_argument_type_mismatch) - << ATR.getRepresentativeType(S.Context) << Ex->getType() + << ATR.getRepresentativeTypeName(S.Context) << Ex->getType() << Ex->getSourceRange(), getLocationOfByte(CS.getStart()), /*IsStringLocation*/true, @@ -2246,7 +2246,7 @@ CheckPrintfHandler::HandlePrintfSpecifier(const analyze_printf::PrintfSpecifier else { S.Diag(getLocationOfByte(CS.getStart()), diag::warn_printf_conversion_argument_type_mismatch) - << ATR.getRepresentativeType(S.Context) << Ex->getType() + << ATR.getRepresentativeTypeName(S.Context) << Ex->getType() << getSpecifierRange(startSpecifier, specifierLen) << Ex->getSourceRange(); } |