Based on a bug report to the Cygwin list: https://cygwin.com/ml/cygwin/2018-05/msg00321.html
* doc/posix-functions/environ.texi (environ): Assigning NULL to environ is a glibc extension. Signed-off-by: Eric Blake <ebl...@redhat.com> --- Does anyone have a better list of platforms where environ=NULL actually fails, or should I just leave this text as written here? ChangeLog | 6 ++++++ doc/posix-functions/environ.texi | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/ChangeLog b/ChangeLog index b23b10919..5aaa8b708 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2018-05-31 Eric Blake <ebl...@redhat.com> + + doc: mention environ pitfall + * doc/posix-functions/environ.texi (environ): Assigning NULL to + environ is a glibc extension. + 2018-05-27 Colin Watson <cjwat...@debian.org> bootstrap: document source fetching in --help diff --git a/doc/posix-functions/environ.texi b/doc/posix-functions/environ.texi index a6c00958d..6d1b8cfaa 100644 --- a/doc/posix-functions/environ.texi +++ b/doc/posix-functions/environ.texi @@ -34,4 +34,10 @@ environ @item The address of this variable is not a compile-time constant on some platforms: mingw. +@item +Assigning NULL to @code{environ} to clear all variables is not +portable; better is to assign @code{environ} to one-element array +containing a NULL pointer. That said, an empty environment is not +portable either, as some systems require particular environment +variables to be present to operate consistently. @end itemize -- 2.14.3