FreeBSD Bugzilla – Attachment 156858 Details for
Bug 200193
lang/clang35 does not handle %D formats properly
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
Updated SemaChecking.cpp patch
patch-tools_clang_lib_Sema_SemaChecking.cpp (text/plain), 1.92 KB, created by
Dimitry Andric
on 2015-05-17 19:23:54 UTC
(
hide
)
Description:
Updated SemaChecking.cpp patch
Filename:
MIME Type:
Creator:
Dimitry Andric
Created:
2015-05-17 19:23:54 UTC
Size:
1.92 KB
patch
obsolete
> >$FreeBSD: head/lang/clang35/files/patch-tools_clang_lib_Sema_SemaChecking.cpp 363768 2014-08-01 22:38:44Z brooks $ > >--- tools/clang/lib/Sema/SemaChecking.cpp.orig >+++ tools/clang/lib/Sema/SemaChecking.cpp >@@ -3074,6 +3074,42 @@ CheckPrintfHandler::HandlePrintfSpecifie > CoveredArgs.set(argIndex); > } > >+ // FreeBSD kernel extensions. >+ if (CS.getKind() == ConversionSpecifier::bArg || >+ CS.getKind() == ConversionSpecifier::DArg) { >+ // We need at least two arguments. >+ if (!CheckNumArgs(FS, CS, startSpecifier, specifierLen, argIndex + 1)) >+ return false; >+ >+ // Claim the second argument. >+ CoveredArgs.set(argIndex + 1); >+ >+ // Type check the first argument (int for %b, pointer for %D) >+ const Expr *Ex = getDataArg(argIndex); >+ const analyze_printf::ArgType &AT = >+ (CS.getKind() == ConversionSpecifier::bArg) ? >+ ArgType(S.Context.IntTy) : ArgType::CPointerTy; >+ if (AT.isValid() && !AT.matchesType(S.Context, Ex->getType())) >+ S.Diag(getLocationOfByte(CS.getStart()), >+ diag::warn_format_conversion_argument_type_mismatch) >+ << AT.getRepresentativeType(S.Context) << Ex->getType() >+ << getSpecifierRange(startSpecifier, specifierLen) >+ << Ex->getSourceRange(); >+ >+ // Type check the second argument (char * for both %b and %D) >+ Ex = getDataArg(argIndex + 1); >+ const analyze_printf::ArgType &AT2 = ArgType::CStrTy; >+ if (AT2.isValid() && !AT2.matchesType(S.Context, Ex->getType())) >+ S.Diag(getLocationOfByte(CS.getStart()), >+ diag::warn_format_conversion_argument_type_mismatch) >+ << AT2.getRepresentativeType(S.Context) << Ex->getType() >+ << getSpecifierRange(startSpecifier, specifierLen) >+ << Ex->getSourceRange(); >+ >+ return true; >+ } >+ // END OF FREEBSD EXTENSIONS >+ > // Check for using an Objective-C specific conversion specifier > // in a non-ObjC literal. > if (!ObjCContext && CS.isObjCArg()) {
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 200193
: 156858