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

Re: [PATCH] Fix compilation on OS X.

From
tsuna <tsunanet@gmail.com>
Date
Jul 21, 2013, 06:10 UTC
Message-ID
<CAFKYj4dRFvTwM_x0mXsOLQCTuw9nAvh3b4bZ+Omg7M5DVNnVzA@mail.gmail.com>
In-Reply-To
<7vr4essbkv.fsf@alter.siamese.dyndns.org>
On Sat, Jul 20, 2013 at 10:53 PM, Junio C Hamano <gitster@pobox.com> wrote:
> Actually, it is _wrong_ for us to rely on system header files to
> define this symbol for us.  Declaring "extern char **environ" is
> responsibility of the user programs (like us).

Actually, that's right. The C99 standard doesn't mention anything about `environ' (only 7.20.4.5 defines `getenv') and POSIX explicitly states "the [environ] variable, which must be declared by the user if it is to be used directly" (http://pubs.opengroup.org/onlinepubs/9699919799/functions/environ.html)

Show 5 quoted lines
> When _GNU_SOURCE is defined glibc header (I think it is unistd.h)
> seem to define it for us.
>
> Perhaps the correct fix is to revert ec535cc2 for everybody, and if
> MinGW needs such a workaround, do it inside #ifndef MINGW?
That sounds right.
-- 
Benoit "tsuna" Sigoure
Previous: Junio C HamanoNext: Benoit Sigoure
Message 7 of 10 in “Fix compilation on OS X.”
  1. Fix compilation on OS X.Benoit Sigoure, Jul 20, 2013
  2. Ramkumar RamachandraJul 20, 2013
  3. tsunaJul 20, 2013
  4. Torsten BögershausenJul 20, 2013
  5. Fix compilation on OS X.Benoit Sigoure, Jul 20, 2013
  6. Junio C HamanoJul 21, 2013
  7. tsunaJul 21, 2013
  8. Revert "compat/unsetenv.c: Fix a sparse warning"Benoit Sigoure, Jul 21, 2013
  9. Revert "compat/unsetenv.c: Fix a sparse warning"Benoit Sigoure, Jul 21, 2013
  10. Junio C HamanoJul 21, 2013

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.