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

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

From
ADAudrey Dutcher <audrey@rhelmot.io>
Date
Feb 21, 2025, 18:02 UTC
Message-ID
<20250221180225.3176533-1-audrey@rhelmot.io>

On OpenBSD, getdelim() in <stdio.h> is behind __POSIX_VISIBLE >= 200809, which is in turn locked behind _XOPEN_SOURCE >= 700. Without this patch, compiling on OpenBSD 7.5 or 7.6, we get implicit declaration errors when compiling with -Werror=implicit-function-declaration (default in clang 19).

[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

Signed-off-by: Audrey Dutcher <audrey@rhelmot.io>
---
 git-compat-util.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/git-compat-util.h b/git-compat-util.h
index e123288e8f..f6902ca2e8 100644
--- a/git-compat-util.h
+++ b/git-compat-util.h
@@ -195,7 +195,7 @@ DISABLE_WARNING(-Wsign-compare)
       !defined(_M_UNIX) && !defined(__sgi) && !defined(__DragonFly__) && \
       !defined(__TANDEM) && !defined(__QNX__) && !defined(__MirBSD__) && \
       !defined(__CYGWIN__)
-#define _XOPEN_SOURCE 600 /* glibc2 and AIX 5.3L need 500, OpenBSD needs 600 for S_ISLNK() */
+#define _XOPEN_SOURCE 700 /* glibc2 and AIX 5.3L need 500, OpenBSD needs 700 for getdelim() */
 #define _XOPEN_SOURCE_EXTENDED 1 /* AIX 5.3L needs this */
 #endif
 #define _ALL_SOURCE 1
-- 
2.43.0
Next: Junio C Hamano
Message 1 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.