--- autoconf.texi.~1.761.~ 1970-01-01 10:00:01.000000000 +1000 +++ autoconf.texi 2003-10-09 14:19:39.000000000 +1000 @@ -3521,6 +3521,21 @@ This is because @code{exit} predates @code{void}, and there was a long tradition of it returning @code{int}. address@hidden @code{putenv} address@hidden @fuindex putenv address@hidden @code{putenv} +POSIX specifies that @code{putenv} puts the given string directly in address@hidden, but some systems make a copy of it instead (eg.@: +glibc 2.0, or BSD). And when a copy is made, @code{unsetenv} might +not free it, causing a memory leak (eg.@: FreeBSD 4). + +POSIX specifies that @code{putenv("FOO")} removes @samp{FOO} from the +environment, but on some systems (eg.@: FreeBSD 4) this is not the +case and instead @code{unsetenv} must be used. + +On MINGW, a call @code{putenv("FOO=")} removes @samp{FOO} from the +environment, rather than inserting it with an empty value. + @item @code{snprintf} @c @fuindex snprintf @prindex @code{snprintf} @@ -3586,6 +3601,13 @@ on DOS it could even lead to file system corruption, as the file might end up being written to after the OS has removed it. address@hidden @code{unsetenv} address@hidden @fuindex unsetenv address@hidden @code{unsetenv} +On MINGW, @code{unsetenv} is not available, but a variable @samp{FOO} +can be removed with a call @code{putenv("FOO=")}, as described under address@hidden above. + @item @code{va_copy} @c @fuindex va_copy @prindex @code{va_copy}