From 2f79004f856532c479b79e226798a3dcc0a127f0 Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Sat, 24 Oct 2015 11:23:37 -0700 Subject: [PATCH] strptime() on OpenBSD requires _XOPEN_SOURCE_EXTENDED 1 (fix #999) strptime() is an XPG4v2 function, on OpenBSD the prototype is not included in time.h unless visibility is set, it needs either "#define _XOPEN_SOURCE_EXTENDED 1" or _XOPEN_SOURCE >= 500. Without this the prototype isn't included and strptime's returned pointer is truncated to an int, causing SEGV on 64-bit arches when using it. Thanks @sthen --- src/builtin.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/builtin.c b/src/builtin.c index 3f7792d1..b49010a5 100644 --- a/src/builtin.c +++ b/src/builtin.c @@ -1,6 +1,7 @@ #define _BSD_SOURCE #define _GNU_SOURCE #define _XOPEN_SOURCE +#define _XOPEN_SOURCE_EXTENDED 1 #include #include #include