[PATCH] PPC64 remove remaining references to _itoa

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[PATCH] PPC64 remove remaining references to _itoa

Steven Munroe
Recent _itoa.c and _itoaw.c changes removed _itoa from 64-bit platforms.
I see build breaks due to remaining references to _itoa from dl-misc.c
and dl-version.c. The following patch change dl-misc.c and dl-version.c
to use _itoa_word instead. This resolves the build break for PPC64.


2007-01-24  Steven Munroe  <[hidden email]>

        * elf/dl-misc.c (_dl_debug_vdprintf): Replace _itoa with _itoa_word.
        * elf/dl-version.c (match_symbol): Replace _itoa with _itoa_word.
        (_dl_check_map_versions): Replace _itoa with _itoa_word.

diff -urN libc25-cvstip-20070123/elf/dl-misc.c libc24/elf/dl-misc.c
--- libc25-cvstip-20070123/elf/dl-misc.c 2006-07-10 16:50:36.000000000 -0500
+++ libc24/elf/dl-misc.c 2007-01-24 16:34:59.000000000 -0600
@@ -107,7 +107,7 @@
       char *p;
       pid = __getpid ();
       assert (pid >= 0 && sizeof (pid_t) <= 4);
-      p = _itoa (pid, &pidbuf[10], 10, 0);
+      p = _itoa_word (pid, &pidbuf[10], 10, 0);
       while (p > pidbuf)
  *--p = ' ';
       pidbuf[10] = ':';
@@ -195,7 +195,7 @@
    having more than one integer formatting in a call.  */
  char *buf = (char *) alloca (3 * sizeof (unsigned long int));
  char *endp = &buf[3 * sizeof (unsigned long int)];
- char *cp = _itoa (num, endp, *fmt == 'x' ? 16 : 10, 0);
+ char *cp = _itoa_word (num, endp, *fmt == 'x' ? 16 : 10, 0);
 
  /* Pad to the width the user specified.  */
  if (width != -1)
diff -urN libc25-cvstip-20070123/elf/dl-version.c libc24/elf/dl-version.c
--- libc25-cvstip-20070123/elf/dl-version.c 2005-03-07 00:45:14.000000000 -0600
+++ libc24/elf/dl-version.c 2007-01-24 16:35:45.000000000 -0600
@@ -123,7 +123,7 @@
   buf[sizeof (buf) - 1] = '\0';
   /* XXX We cannot translate the message.  */
   errstring = make_string ("unsupported version ",
-   _itoa (def->vd_version,
+   _itoa_word (def->vd_version,
   &buf[sizeof (buf) - 1], 10, 0),
    " of Verdef record");
   result = 1;
@@ -212,7 +212,7 @@
   buf[sizeof (buf) - 1] = '\0';
   /* XXX We cannot translate the message.  */
   errstring = make_string ("unsupported version ",
-   _itoa (ent->vn_version,
+   _itoa_word (ent->vn_version,
   &buf[sizeof (buf) - 1], 10, 0),
    " of Verneed record\n");
  call_error:
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] PPC64 remove remaining references to _itoa

Roland McGrath
itoa.h really ought to do

# if LLONG_MAX == LONG_MAX
#  define _itoa _itoa_word
# endif

instead of every use changing conditionally.