From: NAKAMURA Takumi Date: Thu, 20 Sep 2012 11:03:56 +0000 (+0000) Subject: clang/test/Analysis: Fix the declaration of strlen() for 32 bit targets. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9620aa8c6726330c0357799706aa51f64cc449da;p=clang clang/test/Analysis: Fix the declaration of strlen() for 32 bit targets. - Inputs/system-header-simulator.h: Declare strlen() with size_t. - malloc-interprocedural.c: Move the definition of size_t into the header above. Then XFAIL can be pruned. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164300 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/test/Analysis/Inputs/system-header-simulator.h b/test/Analysis/Inputs/system-header-simulator.h index 5790fb9cff..e28b890603 100644 --- a/test/Analysis/Inputs/system-header-simulator.h +++ b/test/Analysis/Inputs/system-header-simulator.h @@ -15,7 +15,9 @@ int fscanf(FILE *restrict, const char *restrict, ...); // Note, on some platforms errno macro gets replaced with a function call. extern int errno; -unsigned long strlen(const char *); +typedef __typeof(sizeof(int)) size_t; + +size_t strlen(const char *); char *strcpy(char *restrict, const char *restrict); diff --git a/test/Analysis/malloc-interprocedural.c b/test/Analysis/malloc-interprocedural.c index 9d02daaa84..79cbf247dd 100644 --- a/test/Analysis/malloc-interprocedural.c +++ b/test/Analysis/malloc-interprocedural.c @@ -1,10 +1,7 @@ // RUN: %clang_cc1 -analyze -analyzer-checker=unix.Malloc -analyzer-inline-max-stack-depth=5 -verify %s -// XFAIL: cygwin,mingw32,win32 - #include "Inputs/system-header-simulator.h" -typedef __typeof(sizeof(int)) size_t; void *malloc(size_t); void *valloc(size_t); void free(void *);