bug-tar
[Top][All Lists]
Advanced

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

Re: [Bug-tar] Compilation/configuration errors with tar-1.15


From: Paul Eggert
Subject: Re: [Bug-tar] Compilation/configuration errors with tar-1.15
Date: Mon, 04 Apr 2005 11:50:22 -0700
User-agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.4 (gnu/linux)

Joerg Schilling <address@hidden> writes:

> "argp-parse.c", line 485: warning: pointer to void or function used in 
> arithmetic

That problem is fixed in tar 1.15.1, I think.  People should be using
1.15.1, not 1.15.

> "buffer.c", line 170: warning: initialization type mismatch

Thanks for reporting that.  I installed this patch and it should
appear in the next tar version.

2005-04-04  Paul Eggert  <address@hidden>

        * src/buffer.c (struct zip_magic): Use char arrays, not pointers.
        The unsigned char * pointer ran afoul of pedantic C compilers, and
        we didn't need pointers anyway.  Put the size field before the
        data to avoid unnecessary padding.  All uses changed.
        (magic) Make it const, since it doesn't change.  All uses changed.

--- buffer.c.~1.80.~    2005-02-05 02:33:05 -0800
+++ buffer.c    2005-04-04 11:18:19 -0700
@@ -159,17 +159,17 @@ enum compress_type {
 struct zip_magic
 {
   enum compress_type type;
-  unsigned char *magic;
   size_t length;
-  char *program;
-  char *option;
+  char magic[sizeof "BZh" - 1];
+  char program[sizeof "compress"];
+  char option[sizeof "-Z"];
 };
 
-static struct zip_magic magic[] = {
+static struct zip_magic const magic[] = {
   { ct_none, },
-  { ct_compress, "\037\235", 2, "compress", "-Z" },
-  { ct_gzip,     "\037\213", 2, "gzip", "-z"  },
-  { ct_bzip2,    "BZh",      3, "bzip2", "-j" },
+  { ct_compress, 2, "\037\235", "compress", "-Z" },
+  { ct_gzip,     2, "\037\213", "gzip", "-z"  },
+  { ct_bzip2,    3, "BZh",      "bzip2", "-j" },
 };
 
 #define NMAGIC (sizeof(magic)/sizeof(magic[0]))
@@ -181,7 +181,7 @@ static struct zip_magic magic[] = {
 enum compress_type 
 check_compressed_archive ()
 {
-  struct zip_magic *p;
+  struct zip_magic const *p;
   bool sfr, srp;
 
   /* Prepare global data needed for find_next_block: */




reply via email to

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