commit 191d21f2acde7c2fa3003972a8b04bc080d64e2d parent 57459439db1f48dbbace1ab059117798fa26d203 Author: Laurent Bercot <ska-skaware@skarnet.org> Date: Thu, 3 May 2018 07:17:05 +0000 Add nullispointer sysdep Diffstat:
M | configure | | | 1 | + |
A | src/sysdeps/trynullispointer.c | | | 12 | ++++++++++++ |
2 files changed, 13 insertions(+), 0 deletions(-)
diff --git 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 @@ -0,0 +1,12 @@ +/* ISC license. */ + +/* Explanation: http://www.openwall.com/lists/musl/2013/01/09/13 */ + +#include <stddef.h> + +int main (void) +{ + char s[1][1+(int)NULL] ; + int i = 0 ; + return sizeof s[i++], !i ; +}