olga / rpms / glibc

Forked from rpms/glibc 5 years ago
Clone

Blame SOURCES/glibc-rh1505492-unused-16.patch

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