Index: lib/StaticAnalyzer/Checkers/GenericTaintChecker.cpp =================================================================== --- lib/StaticAnalyzer/Checkers/GenericTaintChecker.cpp +++ lib/StaticAnalyzer/Checkers/GenericTaintChecker.cpp @@ -637,7 +637,8 @@ if ((D->getName().find("stdin") != StringRef::npos) && D->isExternC()) if (const PointerType * PtrTy = dyn_cast(D->getType().getTypePtr())) - if (PtrTy->getPointeeType() == C.getASTContext().getFILEType()) + if (PtrTy->getPointeeType().getCanonicalType() == + C.getASTContext().getFILEType().getCanonicalType()) return true; } return false; Index: test/Analysis/Inputs/system-header-simulator.h =================================================================== --- test/Analysis/Inputs/system-header-simulator.h +++ test/Analysis/Inputs/system-header-simulator.h @@ -10,9 +10,9 @@ #endif typedef struct _FILE FILE; -extern FILE *stdin; -extern FILE *stdout; -extern FILE *stderr; +extern struct _FILE *stdin; +extern struct _FILE *stdout; +extern struct _FILE *stderr; // Include a variant of standard streams that occur in the pre-processed file. extern FILE *__stdinp; extern FILE *__stdoutp; @@ -109,4 +109,4 @@ #ifndef NULL #define __DARWIN_NULL 0 #define NULL __DARWIN_NULL -#endif \ No newline at end of file +#endif Index: test/Analysis/taint-generic.c =================================================================== --- test/Analysis/taint-generic.c +++ test/Analysis/taint-generic.c @@ -4,7 +4,7 @@ int getchar(void); typedef struct _FILE FILE; -extern FILE *stdin; +extern struct _FILE *stdin; int fscanf(FILE *restrict stream, const char *restrict format, ...); int sprintf(char *str, const char *format, ...); void setproctitle(const char *fmt, ...); Index: test/Analysis/taint-tester.cpp =================================================================== --- test/Analysis/taint-tester.cpp +++ test/Analysis/taint-tester.cpp @@ -3,7 +3,7 @@ typedef struct _FILE FILE; typedef __typeof(sizeof(int)) size_t; -extern FILE *stdin; +extern struct _FILE *stdin; typedef long ssize_t; ssize_t getline(char ** __restrict, size_t * __restrict, FILE * __restrict); int printf(const char * __restrict, ...);