bug-tar
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-tar] [PATCH] paxutils: remove lint discovered by Sun C compiler


From: Paul Eggert
Subject: [Bug-tar] [PATCH] paxutils: remove lint discovered by Sun C compiler
Date: Sat, 04 Sep 2010 23:45:55 -0700
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.11) Gecko/20100713 Thunderbird/3.0.6

I installed this:

* paxlib/paxlib.h (pax_exit): Remove stray semicolon that I
introduced in the previous patch; sorry about that.
* tests/genfile.c (print_stat): Don't assume that mode_t
promotes to unsigned int when calling a varargs function;
that assumption is not portable.
---
 paxlib/paxlib.h |    2 +-
 tests/genfile.c |    8 ++++----
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/paxlib/paxlib.h b/paxlib/paxlib.h
index 4aaf2eb..eeb445e 100644
--- a/paxlib/paxlib.h
+++ b/paxlib/paxlib.h
@@ -100,7 +100,7 @@ void waitpid_error (char const *);
 void write_error (char const *);
 void write_error_details (char const *, size_t, size_t);
 
-void pax_exit (void) __attribute__ ((noreturn));;
+void pax_exit (void) __attribute__ ((noreturn));
 void fatal_exit (void) __attribute__ ((noreturn));
 
 #define STRINGIFY_BIGINT(i, b) umaxtostr (i, b)
diff --git a/tests/genfile.c b/tests/genfile.c
index 7ebeddf..19cbdcb 100644
--- a/tests/genfile.c
+++ b/tests/genfile.c
@@ -582,13 +582,13 @@ print_stat (const char *name)
        printf ("%lu", (unsigned long) st.st_ino);
       else if (strncmp (p, "mode", 4) == 0)
        {
-         mode_t mask = ~0;
+         unsigned val = st.st_mode;
 
          if (ispunct ((unsigned char) p[4]))
            {
              char *q;
 
-             mask = strtoul (p + 5, &q, 8);
+             val &= strtoul (p + 5, &q, 8);
              if (*q)
                {
                  printf ("\n");
@@ -600,7 +600,7 @@ print_stat (const char *name)
              printf ("\n");
              error (EXIT_FAILURE, 0, _("Unknown field `%s'"), p);
            }
-         printf ("%0o", st.st_mode & mask);
+         printf ("%0o", val);
        }
       else if (strcmp (p, "nlink") == 0)
        printf ("%lu", (unsigned long) st.st_nlink);
@@ -699,7 +699,7 @@ exec_checkpoint (struct action *p)
       if (unlink (p->name))
        error (0, errno, _("cannot unlink `%s'"), p->name);
       break;
-      
+
     default:
       abort ();
     }
-- 
1.7.2




reply via email to

[Prev in Thread] Current Thread [Next in Thread]