[cfe-commits] r41140 - in /cfe/trunk/Sema: SemaChecking.cpp SemaExpr.cpp
Anders Carlsson
andersca at mac.com
Fri Aug 17 08:44:17 PDT 2007
Author: andersca
Date: Fri Aug 17 10:44:17 2007
New Revision: 41140
URL: http://llvm.org/viewvc/llvm-project?rev=41140&view=rev
Log:
Return true in case of error, which is what other functions do.
Modified:
cfe/trunk/Sema/SemaChecking.cpp
cfe/trunk/Sema/SemaExpr.cpp
Modified: cfe/trunk/Sema/SemaChecking.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Sema/SemaChecking.cpp?rev=41140&r1=41139&r2=41140&view=diff
==============================================================================
--- cfe/trunk/Sema/SemaChecking.cpp (original)
+++ cfe/trunk/Sema/SemaChecking.cpp Fri Aug 17 10:44:17 2007
@@ -47,7 +47,7 @@
// Search the KnownFunctionIDs for the identifier.
unsigned i = 0, e = id_num_known_functions;
for (; i != e; ++i) { if (KnownFunctionIDs[i] == FnInfo) break; }
- if (i == e) return true;
+ if (i == e) return false;
// Printf checking.
if (i <= id_vprintf) {
@@ -74,7 +74,7 @@
FDecl, format_idx, Args, NumArgsInCall);
}
- return true;
+ return false;
}
/// CheckBuiltinCFStringArgument - Checks that the argument to the builtin
@@ -90,7 +90,7 @@
Diag(Arg->getLocStart(),
diag::err_cfstring_literal_not_string_constant,
Arg->getSourceRange());
- return false;
+ return true;
}
const char *Data = Literal->getStrData();
@@ -112,7 +112,7 @@
}
}
- return true;
+ return false;
}
/// CheckPrintfArguments - Check calls to printf (and similar functions) for
Modified: cfe/trunk/Sema/SemaExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Sema/SemaExpr.cpp?rev=41140&r1=41139&r2=41140&view=diff
==============================================================================
--- cfe/trunk/Sema/SemaExpr.cpp (original)
+++ cfe/trunk/Sema/SemaExpr.cpp Fri Aug 17 10:44:17 2007
@@ -561,7 +561,7 @@
if (ImplicitCastExpr *IcExpr = dyn_cast<ImplicitCastExpr>(Fn))
if (DeclRefExpr *DRExpr = dyn_cast<DeclRefExpr>(IcExpr->getSubExpr()))
if (FunctionDecl *FDecl = dyn_cast<FunctionDecl>(DRExpr->getDecl()))
- if (!CheckFunctionCall(Fn, LParenLoc, RParenLoc, FDecl, Args, NumArgsInCall))
+ if (CheckFunctionCall(Fn, LParenLoc, RParenLoc, FDecl, Args, NumArgsInCall))
return true;
return new CallExpr(Fn, Args, NumArgsInCall, resultType, RParenLoc);
More information about the cfe-commits
mailing list