]> Dogcows Code - chaz/tar/commitdiff
tar: pacify GCC 5.1 -Wformat-signedness
authorPaul Eggert <eggert@cs.ucla.edu>
Mon, 13 Jul 2015 16:29:51 +0000 (09:29 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Mon, 13 Jul 2015 16:53:55 +0000 (09:53 -0700)
* lib/wordsplit.c (struct wordsplit_node.flags):
Now unsigned, so that 'printf ("%x", p->flags)' doesn't provoke GCC.
* src/incremen.c (read_num, dumpdir_ok):
Don't printf an int with %x or %o.

lib/wordsplit.c
src/incremen.c

index bda64d31f9bdca8dd3b2e35916d9b997caba9960..69db2e0335e9b57c1710d2669dec043c42cc2b20 100644 (file)
@@ -221,7 +221,7 @@ struct wordsplit_node
 {
   struct wordsplit_node *prev; /* Previous element */
   struct wordsplit_node *next; /* Next element */
 {
   struct wordsplit_node *prev; /* Previous element */
   struct wordsplit_node *next; /* Next element */
-  int flags;                   /* Node flags */
+  unsigned flags;              /* Node flags */
   union
   {
     struct
   union
   {
     struct
index b1b70ba41764b04049853d12834cf520d12f0254..e549bbd312a43529ead17d1e0d28a86223f479df 100644 (file)
@@ -735,7 +735,7 @@ scan_directory (struct tar_stat_info *st)
     savedir_error (dir);
 
   info_attach_exclist (st);
     savedir_error (dir);
 
   info_attach_exclist (st);
-  
+
   tmp = xstrdup (dir);
   zap_slashes (tmp);
 
   tmp = xstrdup (dir);
   zap_slashes (tmp);
 
@@ -1155,11 +1155,14 @@ read_num (FILE *fp, char const *fieldname,
     }
 
   if (c)
     }
 
   if (c)
-    FATAL_ERROR ((0, 0,
-                 _("%s: byte %s: %s %s followed by invalid byte 0x%02x"),
-                 quotearg_colon (listed_incremental_option),
-                 offtostr (ftello (fp), offbuf),
-                 fieldname, buf, c));
+    {
+      unsigned uc = c;
+      FATAL_ERROR ((0, 0,
+                   _("%s: byte %s: %s %s followed by invalid byte 0x%02x"),
+                   quotearg_colon (listed_incremental_option),
+                   offtostr (ftello (fp), offbuf),
+                   fieldname, buf, uc));
+    }
 
   *pval = strtosysint (buf, NULL, min_val, max_val);
   conversion_errno = errno;
 
   *pval = strtosysint (buf, NULL, min_val, max_val);
   conversion_errno = errno;
@@ -1541,9 +1544,10 @@ dumpdir_ok (char *dumpdir)
     {
       if (expect && *p != expect)
        {
     {
       if (expect && *p != expect)
        {
+         unsigned char uc = *p;
          ERROR ((0, 0,
                  _("Malformed dumpdir: expected '%c' but found %#3o"),
          ERROR ((0, 0,
                  _("Malformed dumpdir: expected '%c' but found %#3o"),
-                 expect, *p));
+                 expect, uc));
          return false;
        }
       switch (*p)
          return false;
        }
       switch (*p)
This page took 0.023213 seconds and 4 git commands to generate.