From d9699264e0578df253f4b1d26321198bedb62017 Mon Sep 17 00:00:00 2001 From: Raghavendra Prabhu Date: Fri, 12 Aug 2016 08:59:00 -0700 Subject: [PATCH] Fixes/updates to build on linux. Summary: a) An update to build-infer.sh to avoid downloading/building 4.02.3 ocaml compiler when it is already present. b) Add the ifdef to avoid this error on glibc systems: clang -c -w libc_basic.c -o libc_basic.o libc_basic.c:692:12: error: unknown type name '__WAIT_STATUS' pid_t wait(__WAIT_STATUS stat_loc) { ^ Closes https://github.com/facebook/infer/pull/429 Reviewed By: akotulski Differential Revision: D3704604 Pulled By: jvillard fbshipit-source-id: d557f1b --- infer/models/c/src/libc_basic.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/infer/models/c/src/libc_basic.c b/infer/models/c/src/libc_basic.c index cb88d989e..f6f52057d 100644 --- a/infer/models/c/src/libc_basic.c +++ b/infer/models/c/src/libc_basic.c @@ -683,6 +683,16 @@ unsigned sleep(unsigned seconds) { #define __WAIT_STATUS int* #endif +// glibc 2.24 did away with 'union wait' and replaced it with int*. +// Hence, we re-define __WAIT_STATUS if glibc is >= 2.24. +#ifndef __GLIBC_PREREQ +#define __GLIBC_PREREQ(x, y) 0 +#endif + +#if defined(__GLIBC__) && __GLIBC_PREREQ(2, 24) +#define __WAIT_STATUS int* +#endif + // the waiting is modeled as skip. Then the return value is a random value of a // process or // -1 in case of an error