brintos

brintos / llvm-project-archived public Read only

0
0
Text · 882 B · 47adf8e Raw
25 lines · c
1// Like the compiler, the static analyzer treats some functions differently if2// they come from a system header -- for example, it is assumed that system3// functions do not arbitrarily free() their parameters, and that some bugs4// found in system headers cannot be fixed by the user and should be5// suppressed.6#pragma clang system_header7 8typedef __typeof(sizeof(int)) size_t;9typedef struct _FILE {10  unsigned char *_p;11} FILE;12FILE *fopen(const char *restrict, const char *restrict) __asm("_" "fopen" );13int fputc(int, FILE *);14int fputs(const char *restrict, FILE *restrict) __asm("_" "fputs" );15size_t fread(void *buffer, size_t size, size_t count, FILE *stream);16int fgetc(FILE *stream);17int fclose(FILE *);18void exit(int);19 20// The following is a fake system header function21typedef struct __FileStruct {22  FILE * p;23} FileStruct;24void fakeSystemHeaderCall(FileStruct *);25