]> granicus.if.org Git - clang/commitdiff
Temporarily only enable 'open' check on Mac OS X to unbreak Windows buildbot. I'm
authorTed Kremenek <kremenek@apple.com>
Thu, 8 Apr 2010 21:54:13 +0000 (21:54 +0000)
committerTed Kremenek <kremenek@apple.com>
Thu, 8 Apr 2010 21:54:13 +0000 (21:54 +0000)
looking into an alternate fix right now.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100816 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Checker/UnixAPIChecker.cpp

index 0c9a45f06f04bff5545a28d3c8a0d7644c2f516a..213e7980053774425329f19407e0a0c34e44d9e1 100644 (file)
 #include "GRExprEngineInternalChecks.h"
 #include "clang/Checker/PathSensitive/CheckerVisitor.h"
 #include "clang/Checker/BugReporter/BugType.h"
+#include "clang/Analysis/Support/Optional.h"
 #include "llvm/ADT/StringSwitch.h"
 #include <fcntl.h>
 
+#include "clang/Basic/TargetInfo.h"
+
+
 using namespace clang;
 
 namespace {
@@ -57,6 +61,9 @@ static inline void LazyInitialize(BugType *&BT, const char *name) {
 //===----------------------------------------------------------------------===//
 
 static void CheckOpen(CheckerContext &C, const CallExpr *CE, BugType *&BT) {
+  if (C.getASTContext().Target.getTriple().getVendor() != llvm::Triple::Apple)
+    return;
+  
   LazyInitialize(BT, "Improper use of 'open'");
 
   // Look at the 'oflags' argument for the O_CREAT flag.