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

[PATCH 4/6] Fix an "implicit function definition" warning.

From
Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Date
Mar 3, 2007, 18:28 UTC
Message-ID
<45E9BE64.5030904@ramsay1.demon.co.uk>

The function at issue being initgroups() from the <grp.h> header file. On Cygwin, setting _XOPEN_SOURCE suppresses the definition of initgroups(), which causes the warning while compiling daemon.c.

Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
---
  git-compat-util.h |    6 ++++++
  1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/git-compat-util.h b/git-compat-util.h
index c1bcb00..e54604e 100644
--- a/git-compat-util.h
+++ b/git-compat-util.h
@@ -47,9 +47,15 @@
  #include <netdb.h>
  #include <pwd.h>
  #include <inttypes.h>
+#if defined(__CYGWIN__)
+#undef _XOPEN_SOURCE
+#include <grp.h>
+#define _XOPEN_SOURCE 600
+#else
  #undef _ALL_SOURCE /* AIX 5.3L defines a struct list with _ALL_SOURCE. */
  #include <grp.h>
  #define _ALL_SOURCE 1
+#endif

  #ifndef NO_ICONV
  #include <iconv.h>
-- 
1.5.0
Message 1 of 1 in “Fix an "implicit function definition" warning.”
  1. 4/6 Fix an "implicit function definition" warning.Ramsay Jones, Mar 3, 2007

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.