# HG changeset patch # User Paul Eggert # Date 1360623536 28800 # Node ID bb52d9cece011d5fb45b1a8c92aee294e3118a5d # Parent 0fb629c87fb59fc68da3ca2dfb149fe39502d08d unsetenv etc.: port to Solaris 11 + GNU Emacs * lib/canonicalize-lgpl.c, lib/getaddrinfo.c, lib/getdelim.c: * lib/glob.c, lib/random_r.c, lib/setenv.c, lib/tsearch.c: * lib/unsetenv.c (_GL_ARG_NONNULL): Define before including . GNU Emacs's includes (which is not a great idea but is too painful to fix right now), and without this gnulib change was defining _GL_ARG_NONNULL incorrectly when compiling unsetenv.c on Solaris 11. Fix the problem for unsetenv.c, and fix other similar occurrences. diff --git a/ChangeLog b/ChangeLog --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2013-02-11 Paul Eggert + + unsetenv etc.: port to Solaris 11 + GNU Emacs + * lib/canonicalize-lgpl.c, lib/getaddrinfo.c, lib/getdelim.c: + * lib/glob.c, lib/random_r.c, lib/setenv.c, lib/tsearch.c: + * lib/unsetenv.c (_GL_ARG_NONNULL): Define before including . + GNU Emacs's includes (which is not a great + idea but is too painful to fix right now), and without this gnulib + change was defining _GL_ARG_NONNULL incorrectly when + compiling unsetenv.c on Solaris 11. Fix the problem for + unsetenv.c, and fix other similar occurrences. + 2013-02-09 Paul Eggert secure_getenv: fix C++ declaration typo diff --git a/lib/canonicalize-lgpl.c b/lib/canonicalize-lgpl.c --- a/lib/canonicalize-lgpl.c +++ b/lib/canonicalize-lgpl.c @@ -16,16 +16,16 @@ along with this program. If not, see . */ #ifndef _LIBC +/* Don't use __attribute__ __nonnull__ in this compilation unit. Otherwise gcc + optimizes away the name == NULL test below. */ +# define _GL_ARG_NONNULL(params) + # define _GL_USE_STDLIB_ALLOC 1 # include #endif #if !HAVE_CANONICALIZE_FILE_NAME || !FUNC_REALPATH_WORKS || defined _LIBC -/* Don't use __attribute__ __nonnull__ in this compilation unit. Otherwise gcc - optimizes away the name == NULL test below. */ -#define _GL_ARG_NONNULL(params) - /* Specification. */ #include diff --git a/lib/getaddrinfo.c b/lib/getaddrinfo.c --- a/lib/getaddrinfo.c +++ b/lib/getaddrinfo.c @@ -15,12 +15,12 @@ You should have received a copy of the GNU General Public License along with this program; if not, see . */ -#include - /* Don't use __attribute__ __nonnull__ in this compilation unit. Otherwise gcc optimizes away the sa == NULL test below. */ #define _GL_ARG_NONNULL(params) +#include + #include #if HAVE_NETINET_IN_H diff --git a/lib/getdelim.c b/lib/getdelim.c --- a/lib/getdelim.c +++ b/lib/getdelim.c @@ -17,12 +17,12 @@ /* Ported from glibc by Simon Josefsson. */ -#include - /* Don't use __attribute__ __nonnull__ in this compilation unit. Otherwise gcc optimizes away the lineptr == NULL || n == NULL || fp == NULL tests below. */ #define _GL_ARG_NONNULL(params) +#include + #include #include diff --git a/lib/glob.c b/lib/glob.c --- a/lib/glob.c +++ b/lib/glob.c @@ -15,13 +15,12 @@ along with this program. If not, see . */ #ifndef _LIBC +/* Don't use __attribute__ __nonnull__ in this compilation unit. Otherwise gcc + optimizes away the pattern == NULL || pglob == NULL tests below. */ +# define _GL_ARG_NONNULL(params) # include #endif -/* Don't use __attribute__ __nonnull__ in this compilation unit. Otherwise gcc - optimizes away the pattern == NULL || pglob == NULL tests below. */ -#define _GL_ARG_NONNULL(params) - #include #include diff --git a/lib/random_r.c b/lib/random_r.c --- a/lib/random_r.c +++ b/lib/random_r.c @@ -50,13 +50,13 @@ * Rewritten to be reentrant by Ulrich Drepper, 1995 */ -#include - /* Don't use __attribute__ __nonnull__ in this compilation unit. Otherwise gcc optimizes away the buf == NULL, arg_state == NULL, result == NULL tests below. */ #define _GL_ARG_NONNULL(params) +#include + /* Specification. */ #include diff --git a/lib/setenv.c b/lib/setenv.c --- a/lib/setenv.c +++ b/lib/setenv.c @@ -15,14 +15,14 @@ along with this program. If not, see . */ #if !_LIBC +/* Don't use __attribute__ __nonnull__ in this compilation unit. Otherwise gcc + optimizes away the name == NULL test below. */ +# define _GL_ARG_NONNULL(params) + # define _GL_USE_STDLIB_ALLOC 1 # include #endif -/* Don't use __attribute__ __nonnull__ in this compilation unit. Otherwise gcc - optimizes away the name == NULL test below. */ -#define _GL_ARG_NONNULL(params) - #include /* Specification. */ diff --git a/lib/tsearch.c b/lib/tsearch.c --- a/lib/tsearch.c +++ b/lib/tsearch.c @@ -85,12 +85,12 @@ In this case, A has been rotated left. This preserves the ordering of the binary tree. */ -#include - /* Don't use __attribute__ __nonnull__ in this compilation unit. Otherwise gcc optimizes away the rootp == NULL tests below. */ #define _GL_ARG_NONNULL(params) +#include + /* Specification. */ #ifdef IN_LIBINTL # include "tsearch.h" diff --git a/lib/unsetenv.c b/lib/unsetenv.c --- a/lib/unsetenv.c +++ b/lib/unsetenv.c @@ -14,12 +14,12 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#include - /* Don't use __attribute__ __nonnull__ in this compilation unit. Otherwise gcc optimizes away the name == NULL test below. */ #define _GL_ARG_NONNULL(params) +#include + /* Specification. */ #include