Index: lib/StaticAnalyzer/Checkers/ConversionChecker.cpp =================================================================== --- lib/StaticAnalyzer/Checkers/ConversionChecker.cpp +++ lib/StaticAnalyzer/Checkers/ConversionChecker.cpp @@ -23,6 +23,7 @@ // //===----------------------------------------------------------------------===// #include "ClangSACheckers.h" +#include "InterCheckerAPI.h" #include "clang/AST/ParentMap.h" #include "clang/StaticAnalyzer/Core/BugReporter/BugType.h" #include "clang/StaticAnalyzer/Core/Checker.h" @@ -159,5 +160,6 @@ } void ento::registerConversionChecker(CheckerManager &mgr) { + registerStdCLibraryFunctionsChecker(mgr); mgr.registerChecker(); } Index: lib/StaticAnalyzer/Checkers/InterCheckerAPI.h =================================================================== --- lib/StaticAnalyzer/Checkers/InterCheckerAPI.h +++ lib/StaticAnalyzer/Checkers/InterCheckerAPI.h @@ -23,5 +23,8 @@ /// Register the part of MallocChecker connected to InnerPointerChecker. void registerInnerPointerCheckerAux(CheckerManager &Mgr); +/// Register evaluation of some basic C standard library functions. +void registerStdCLibraryFunctionsChecker(CheckerManager &mgr); + }} #endif /* INTERCHECKERAPI_H_ */ Index: test/Analysis/conversion.c =================================================================== --- test/Analysis/conversion.c +++ test/Analysis/conversion.c @@ -138,15 +138,14 @@ } -// false positives.. +// old false positives.. int isascii(int c); void falsePositive1() { char kb2[5]; int X = 1000; if (isascii(X)) { - // FIXME: should not warn here: - kb2[0] = X; // expected-warning {{Loss of precision}} + kb2[0] = X; // no-warning } } @@ -175,8 +174,7 @@ if (c == EOF) return(4); if (cp < &reply_string[sizeof(reply_string) - 1]) - // FIXME: should not warn here: - *cp++ = c; // expected-warning {{Loss of precision}} + *cp++ = c; // no-warning } } }