25845f
commit ad37480c4b79b801b987f5529d036b4e25cac615
25845f
Author: Martin Sebor <msebor@redhat.com>
25845f
Date:   Fri Jan 15 10:44:07 2016 -0700
25845f
25845f
    Fix build errors with -DNDEBUG.
25845f
    
25845f
            [BZ #18755]
25845f
            * iconv/skeleton.c (FUNCTION_NAME): Suppress -Wunused-but-set-variable
25845f
            warnings.
25845f
            * sysdeps/nptl/gai_misc.h (__gai_start_notify_thread): Same.
25845f
            (__gai_create_helper_thread): Same.
25845f
            * nscd/nscd.c (do_exit): Suppress -Wunused-variable.
25845f
            * iconvdata/iso-2022-cn-ext.c (BODY): Initialize local variable
25845f
            to suppress -Wmaybe-uninitialized warnings.
25845f
25845f
Conflicts:
25845f
	sysdeps/nptl/gai_misc.h
25845f
25845f
Not needed due to missing backport of commit
25845f
74eb826cff5e4277d2d866a92058f27a837f8ff7 (NPTL: Remove gratuitous
25845f
Linuxisms from gai_misc.h.).  File deleted manually.
25845f
25845f
diff --git a/iconv/skeleton.c b/iconv/skeleton.c
25845f
index 3384d520661f88ed..893fee9aaadf91e3 100644
25845f
--- a/iconv/skeleton.c
25845f
+++ b/iconv/skeleton.c
25845f
@@ -682,7 +682,7 @@ FUNCTION_NAME (struct __gconv_step *step, struct __gconv_step_data *data,
25845f
 #else
25845f
 		      /* We have a problem in one of the functions below.
25845f
 			 Undo the conversion upto the error point.  */
25845f
-		      size_t nstatus;
25845f
+		      size_t nstatus __attribute__ ((unused));
25845f
 
25845f
 		      /* Reload the pointers.  */
25845f
 		      *inptrp = inptr;
25845f
diff --git a/iconvdata/iso-2022-cn-ext.c b/iconvdata/iso-2022-cn-ext.c
25845f
index bde266811d967192..c86d8616d417f21b 100644
25845f
--- a/iconvdata/iso-2022-cn-ext.c
25845f
+++ b/iconvdata/iso-2022-cn-ext.c
25845f
@@ -426,7 +426,7 @@ enum
25845f
       }									      \
25845f
     else								      \
25845f
       {									      \
25845f
-	unsigned char buf[2];						      \
25845f
+	unsigned char buf[2] = { 0, 0 };				      \
25845f
 	int used;							      \
25845f
 									      \
25845f
 	if (set == GB2312_set || ((ann & SO_ann) != CNS11643_1_ann	      \
25845f
diff --git a/nscd/nscd.c b/nscd/nscd.c
25845f
index f74a7325ec06e4a6..b088069c0b102846 100644
25845f
--- a/nscd/nscd.c
25845f
+++ b/nscd/nscd.c
25845f
@@ -634,7 +634,8 @@ do_exit (int child_ret, int errnum, const char *format, ...)
25845f
 {
25845f
   if (parent_fd != -1)
25845f
     {
25845f
-      int ret = write (parent_fd, &child_ret, sizeof (child_ret));
25845f
+      int ret __attribute__ ((unused));
25845f
+      ret = write (parent_fd, &child_ret, sizeof (child_ret));
25845f
       assert (ret == sizeof (child_ret));
25845f
       close (parent_fd);
25845f
     }
25845f
@@ -666,7 +667,8 @@ notify_parent (int child_ret)
25845f
   if (parent_fd == -1)
25845f
     return;
25845f
 
25845f
-  int ret = write (parent_fd, &child_ret, sizeof (child_ret));
25845f
+  int ret __attribute__ ((unused));
25845f
+  ret = write (parent_fd, &child_ret, sizeof (child_ret));
25845f
   assert (ret == sizeof (child_ret));
25845f
   close (parent_fd);
25845f
   parent_fd = -1;