Skip to content
Myr

strptime() on OpenBSD requires _XOPEN_SOURCE_EXTENDED 1 (fix #999)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

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

authored by David Tolnay · committed by David Tolnay · parent b7a219a · Browse files · 1 file+1 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+1 added−0 removed

  • other:+1 added−0 removed

1 file+1 added−0 removed

modified:src/builtin.c+1 added
1#define _BSD_SOURCE2#define _GNU_SOURCE3#define _XOPEN_SOURCE4#define _XOPEN_SOURCE_EXTENDED 15#include <sys/time.h>6#include <stdlib.h>7#include <stddef.h>8#ifdef HAVE_ALLOCA_H
1414 unmodified lines