Subject: Re: [PATCH] compat: fixes for header handling with OpenBSD / NetBSD

From: Collin Funk <[email-masked]>
Date: Mon, 02 Jun 2025 21:05:43 -0700

Brad Smith <[email-masked]> writes:

>> Why remove this definition? I think it might be useful on some older
>> systems and seems harmless otherwise.
>
> _XOPEN_SOURCE restricts the build environment. _NETBSD_SOURCE is added
> to counteract
> _XOPEN_SOURCE. Not setting it in the first place provides everything
> by default.
>
> I was removing it as it should no longer be necessary.
>
> But as said, it is harmless. I can leave it in if desired.

In Autoconf's AC_USE_SYSTEM_EXTENSIONS it is defined with the comment:

    /* Enable general extensions on NetBSD.
       Enable NetBSD compatibility extensions on Minix.  */

I would prefer just leaving it for any old system that may need it. Or
in case git uses features from a recent standard that might still be
hidden as a NetBSD extension.

For example, POSIX.1-2024 has been released, but most functions added
there are still under _GNU_SOURCE in current glibc.

Collin