]> Savannah Git Hosting - gnulib.git/commitdiff
unsetenv etc.: port to Solaris 11 + GNU Emacs
authorPaul Eggert <eggert@cs.ucla.edu>
Mon, 11 Feb 2013 22:58:56 +0000 (14:58 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Mon, 11 Feb 2013 22:59:20 +0000 (14:59 -0800)
* 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 <config.h>.
GNU Emacs's <config.h> includes <stdlib.h> (which is not a great
idea but is too painful to fix right now), and without this gnulib
change <stdlib.h> was defining _GL_ARG_NONNULL incorrectly when
compiling unsetenv.c on Solaris 11.  Fix the problem for
unsetenv.c, and fix other similar occurrences.

ChangeLog
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

index df283055f086c51866f030945937211e99f20a4d..9b002b19a4b982752e2dc1c1c2a7f88a7cfa9229 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2013-02-11  Paul Eggert  <eggert@cs.ucla.edu>
+
+       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 <config.h>.
+       GNU Emacs's <config.h> includes <stdlib.h> (which is not a great
+       idea but is too painful to fix right now), and without this gnulib
+       change <stdlib.h> 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  <eggert@cs.ucla.edu>
 
        secure_getenv: fix C++ declaration typo
index d4178fae47a7134ff6afc196ece8f133d179e069..6cbd2e08a0842c79edb41fb6761d7185b2659bca 100644 (file)
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #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 <config.h>
 #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 <stdlib.h>
 
index 4324dd772c0bbff994d47241cc974bde23169242..a6a4066323bd7edc3c82e3679645eb661de829d0 100644 (file)
    You should have received a copy of the GNU General Public License
    along with this program; if not, see <http://www.gnu.org/licenses/>.  */
 
-#include <config.h>
-
 /* Don't use __attribute__ __nonnull__ in this compilation unit.  Otherwise gcc
    optimizes away the sa == NULL test below.  */
 #define _GL_ARG_NONNULL(params)
 
+#include <config.h>
+
 #include <netdb.h>
 
 #if HAVE_NETINET_IN_H
index 20d1da3c5b6bfbf778e117fae84cf94d4b794038..b6a061e1f8cca3eb359ec34986fa04b4070c3fd6 100644 (file)
 
 /* Ported from glibc by Simon Josefsson. */
 
-#include <config.h>
-
 /* 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 <config.h>
+
 #include <stdio.h>
 
 #include <limits.h>
index c65270f793904947a1bc92d62a064dbcb563a98a..bf90a0045053521c210f65c802e299c1ffb2c67d 100644 (file)
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #ifndef _LIBC
-# include <config.h>
-#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)
+# define _GL_ARG_NONNULL(params)
+# include <config.h>
+#endif
 
 #include <glob.h>
 
index 349a7ba66f9c2d8d0dd707d408c5b20c60624830..78f777670e6a7e688a7a60389670023ec10b3e09 100644 (file)
  * Rewritten to be reentrant by Ulrich Drepper, 1995
  */
 
-#include <config.h>
-
 /* 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 <config.h>
+
 /* Specification.  */
 #include <stdlib.h>
 
index d7851a8b7ac1bbc1ddf6f5044ad605171fd19864..995a0f26a1c7c9df954101aa57bc72db751503cf 100644 (file)
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #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 <config.h>
 #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 <alloca.h>
 
 /* Specification.  */
index 7cefa33fa0cfaff71d93f9a0db5dec70fb0e4b43..96cc9991b7235a1d942ec70b346456f3ede977c6 100644 (file)
    In this case, A has been rotated left.  This preserves the ordering of the
    binary tree.  */
 
-#include <config.h>
-
 /* Don't use __attribute__ __nonnull__ in this compilation unit.  Otherwise gcc
    optimizes away the rootp == NULL tests below.  */
 #define _GL_ARG_NONNULL(params)
 
+#include <config.h>
+
 /* Specification.  */
 #ifdef IN_LIBINTL
 # include "tsearch.h"
index eea21129031bf1befdd563317e3f16e75556a0c4..c58c82f4f44115d846117398696347f5e7f8771c 100644 (file)
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
-#include <config.h>
-
 /* Don't use __attribute__ __nonnull__ in this compilation unit.  Otherwise gcc
    optimizes away the name == NULL test below.  */
 #define _GL_ARG_NONNULL(params)
 
+#include <config.h>
+
 /* Specification.  */
 #include <stdlib.h>