git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] git-compat-util.h: Bump _XOPEN_SOURCE on OpenBSD

From
Jeff King <peff@peff.net>
Date
Feb 21, 2025, 20:54 UTC
Message-ID
<20250221205448.GA3069593@coredump.intra.peff.net>
In-Reply-To
<CADanSV3w++kkTgedLQorKgJ15kc5bEkNvYTidRU1UbwW4jCC6Q@mail.gmail.com>
On Fri, Feb 21, 2025 at 01:41:08PM -0700, Audrey Dutcher wrote:
Show 20 quoted lines
> > Is this a recent regression?  Blaming these two line ranges ...
> >
> > >
> > > [1] https://github.com/openbsd/src/blob/6a403588e27467d1f271831ca1de62a3befea6a0/include/stdio.h#L236-L237
> > > [2] https://github.com/openbsd/src/blob/6a403588e27467d1f271831ca1de62a3befea6a0/sys/sys/cdefs.h#L299-L302
> >
> > ... in the OpenBSD repository says they haven't changed for many
> > years, and I am wondering what triggered this all of a sudden.
> >
> > If we know how we used to have no issue, in addition to how we now
> > have issue with the current OpenBSD (which you outlined very well
> > above), and when the situation changed, please add to the proposed
> > log message.  That would help people on OpenBSD to decide when they
> > want to upgrade their copy of Git.
> 
> The thing that changed was the release of clang 19, which enabled the
> mentioned Werror by default. This is showing up now because I am
> experimenting with building software for OpenBSD through nixpkgs,
> which prefers the most recent version of everything. I am not sure
> what of this is appropriate to add to the commit message.

I'd guess a missing piece of the puzzle is your config.mak settings. We do not use getdelim() unless HAVE_GETDELIM is set, and our default platform settings in config.mak.uname do so only for Linux and macOS.

There is a check for it in configure.ac, so if you are using autoconf, that may enable it in config.mak.autogen. But most Git developers (who ordinarily would build with -Werror) do not use autoconf. So that may explain why nobody complained about it until now.

I do wonder if the autoconf test should be more picky about making sure it builds without warnings, but I'd guess those are usually lenient by default to avoid false negatives.

All that said, fixing the source to build without warnings like you are doing is obviously the right thing to do.

Patches to config.mak.uname to turn it on by default for OpenBSD would also be welcome. We tend to be conservative in flipping those switches, and wait until somebody who actively uses the platform and cares enough proposes a patch.

-Peff
Previous: Audrey DutcherNext: Junio C Hamano
Message 4 of 5 in “git-compat-util.h: Bump _XOPEN_SOURCE on OpenBSD”
  1. git-compat-util.h: Bump _XOPEN_SOURCE on OpenBSDAudrey Dutcher, Feb 21, 2025
  2. Junio C HamanoFeb 21, 2025
  3. Audrey DutcherFeb 21, 2025
  4. Jeff KingFeb 21, 2025
  5. Junio C HamanoFeb 22, 2025

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.