From 191d21f2acde7c2fa3003972a8b04bc080d64e2d Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Thu, 3 May 2018 07:17:05 +0000 Subject: Add nullispointer sysdep --- configure | 1 + src/sysdeps/trynullispointer.c | 12 ++++++++++++ 2 files changed, 13 insertions(+) create mode 100644 src/sysdeps/trynullispointer.c diff --git a/configure b/configure index f785a63..3959c9a 100755 --- a/configure +++ b/configure @@ -503,6 +503,7 @@ EOF rm -f tryendianness trytypes + choose clr nullispointer NULLISPOINTER 'a pointer-typed NULL' choose clr accept4 ACCEPT4 'accept4()' choose clr ancilautoclose ANCILAUTOCLOSE 'auto-close after fd-passing' choose c cmsgcloexec CMSGCLOEXEC 'MSG_CMSG_CLOEXEC' diff --git a/src/sysdeps/trynullispointer.c b/src/sysdeps/trynullispointer.c new file mode 100644 index 0000000..cbb3340 --- /dev/null +++ b/src/sysdeps/trynullispointer.c @@ -0,0 +1,12 @@ +/* ISC license. */ + +/* Explanation: http://www.openwall.com/lists/musl/2013/01/09/13 */ + +#include + +int main (void) +{ + char s[1][1+(int)NULL] ; + int i = 0 ; + return sizeof s[i++], !i ; +} -- cgit v1.2.3