]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Fix build failures with -DDEBUG.
authorMartin Sebor <msebor@redhat.com>
Fri, 15 Jan 2016 18:07:41 +0000 (11:07 -0700)
committerMartin Sebor <msebor@redhat.com>
Fri, 15 Jan 2016 18:07:41 +0000 (11:07 -0700)
        [BZ #19443]
        * crypt/crypt_util.c [DEBUG] (_ufc_prbits): Correct format string.
        [DEBUG] (_ufc_set_bits): Declare used.
        * iconv/gconv_dl.c [DEBUG]: Add a missing include directive.
        [DEBUG] (print_all): Declare used.
        * resolv/res_send.c [DEBUG] (__libc_res_nsend): Explicitly convert
        operands of the ternary ?: expression to target type.
        * stdlib/rshift.c [DEBUG] (mpn_rshift): Use assert() instead of
        calling the undeclared abort.
        * time/mktime.c [DEBUG] (DEBUG): Rename to DEBUG_MKTIME.

ChangeLog
crypt/crypt_util.c
iconv/gconv_dl.c
resolv/res_send.c
stdlib/rshift.c
time/mktime.c

index 18dd421510834697a77f0b73a9837f33a017bf50..a9d575f2cbca529be5548bd99f995c9d595153ab 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2016-01-15  Martin Sebor  <msebor@redhat.com>
+
+       [BZ #19443]
+       * crypt/crypt_util.c [DEBUG] (_ufc_prbits): Correct format string.
+       [DEBUG] (_ufc_set_bits): Declare used.
+       * iconv/gconv_dl.c [DEBUG]: Add a missing include directive.
+       [DEBUG] (print_all): Declare used.
+       * resolv/res_send.c [DEBUG] (__libc_res_nsend): Explicitly convert
+       operands of the ternary ?: expression to target type.
+       * stdlib/rshift.c [DEBUG] (mpn_rshift): Use assert() instead of
+       calling the undeclared abort.
+       * time/mktime.c [DEBUG] (DEBUG): Rename to DEBUG_MKTIME.
+
 2016-01-15  Martin Sebor  <msebor@redhat.com>
 
        [BZ #18755]
index 4b6490ebd648b824eaea195053084158d40d1b6a..1f42f59cb06f3ac9be7ffad6115a407b8dcf8ced 100644 (file)
@@ -271,12 +271,12 @@ _ufc_prbits (ufc_long *a, int n)
       t=8*i+j;
       tmp|=(a[t/24] & BITMASK[t % 24])?bytemask[j]:0;
     }
-    (void)printf("%02x ",tmp);
+    (void)printf("%02lx ", tmp);
   }
   printf(" ");
 }
 
-static void
+static void __attribute__ ((unused))
 _ufc_set_bits (ufc_long v, ufc_long *b)
 {
   ufc_long i;
index 86559d3f3fb095a7b08986ea50a6ebb64903b90c..4e9dfea437d9bc7f0ed1c7baf519dc2e59c2d98e 100644 (file)
@@ -219,6 +219,9 @@ libc_freeres_fn (free_mem)
 
 
 #ifdef DEBUG
+
+#include <stdio.h>
+
 static void
 do_print (const void *nodep, VISIT value, int level)
 {
@@ -231,7 +234,7 @@ do_print (const void *nodep, VISIT value, int level)
          obj->name, obj->counter);
 }
 
-static void
+static void __attribute__ ((used))
 print_all (void)
 {
   __twalk (loaded, do_print);
index 3550740ada0774c6d50d37a4011d5119876e3543..a968b95b4a571144dcb5cbd4003b31f73910a2a7 100644 (file)
@@ -499,8 +499,8 @@ __libc_res_nsend(res_state statp, const u_char *buf, int buflen,
                       (stdout, ";; Querying server (# %d) address = %s\n",
                        ns + 1, inet_ntop(nsap->sa_family,
                                          (nsap->sa_family == AF_INET6
-                                          ? &((struct sockaddr_in6 *) nsap)->sin6_addr
-                                          : &((struct sockaddr_in *) nsap)->sin_addr),
+                                          ? (void *) &((struct sockaddr_in6 *) nsap)->sin6_addr
+                                          : (void *) &((struct sockaddr_in *) nsap)->sin_addr),
                                          tmpbuf, sizeof (tmpbuf))));
 
                if (__glibc_unlikely (v_circuit))       {
index 4cf345c97e6817b29417291f7debcdc4e6644d77..d76b9c8c02669a4fcbbccce3cb9cf10322c4858d 100644 (file)
@@ -21,6 +21,8 @@ along with the GNU MP Library; see the file COPYING.LIB.  If not, see
 #include <gmp.h>
 #include "gmp-impl.h"
 
+#include <assert.h>
+
 /* Shift U (pointed to by UP and USIZE limbs long) CNT bits to the right
    and store the USIZE least significant limbs of the result at WP.
    The bits shifted out to the right are returned.
@@ -40,10 +42,7 @@ mpn_rshift (register mp_ptr wp,
   register mp_size_t i;
   mp_limb_t retval;
 
-#ifdef DEBUG
-  if (usize == 0 || cnt == 0)
-    abort ();
-#endif
+  assert (usize != 0 && cnt != 0);
 
   sh_1 = cnt;
 
index 7d06314d877208eea83a041f4dae1bdf48bc7ad8..bc7ed5674ba81d47b07abfcc5c2dd3cbbe63a8aa 100644 (file)
@@ -19,7 +19,7 @@
 
 /* Define this to have a standalone program to test this implementation of
    mktime.  */
-/* #define DEBUG 1 */
+/* #define DEBUG_MKTIME 1 */
 
 #ifndef _LIBC
 # include <config.h>
 
 #include <string.h>            /* For the real memcpy prototype.  */
 
-#if defined DEBUG && DEBUG
+#if defined DEBUG_MKTIME && DEBUG_MKTIME
 # include <stdio.h>
 # include <stdlib.h>
 /* Make it work even if the system's libc has its own mktime routine.  */
 # undef mktime
 # define mktime my_mktime
-#endif /* DEBUG */
+#endif /* DEBUG_MKTIME */
 
 /* Some of the code in this file assumes that signed integer overflow
    silently wraps around.  This assumption can't easily be programmed
@@ -600,7 +600,7 @@ libc_hidden_def (mktime)
 libc_hidden_weak (timelocal)
 #endif
 \f
-#if defined DEBUG && DEBUG
+#if defined DEBUG_MKTIME && DEBUG_MKTIME
 
 static int
 not_equal_tm (const struct tm *a, const struct tm *b)
@@ -732,10 +732,10 @@ main (int argc, char **argv)
   return status;
 }
 
-#endif /* DEBUG */
+#endif /* DEBUG_MKTIME */
 \f
 /*
 Local Variables:
-compile-command: "gcc -DDEBUG -I. -Wall -W -O2 -g mktime.c -o mktime"
+compile-command: "gcc -DDEBUG_MKTIME -I. -Wall -W -O2 -g mktime.c -o mktime"
 End:
 */