]> granicus.if.org Git - clang/commitdiff
clang/test/Analysis: Fix the declaration of strlen() for 32 bit targets.
authorNAKAMURA Takumi <geek4civic@gmail.com>
Thu, 20 Sep 2012 11:03:56 +0000 (11:03 +0000)
committerNAKAMURA Takumi <geek4civic@gmail.com>
Thu, 20 Sep 2012 11:03:56 +0000 (11:03 +0000)
  - 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

test/Analysis/Inputs/system-header-simulator.h
test/Analysis/malloc-interprocedural.c

index 5790fb9cff4a138d95db5553ddf96a07b4c5b192..e28b8906037215610725975f85b9d9bbf2fba504 100644 (file)
@@ -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);
 
index 9d02daaa846f8d71fa7b4152e0de11f884cd5a35..79cbf247dd949feed2c3fedbf1c68e92626690f3 100644 (file)
@@ -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 *);