bug-tar
[Top][All Lists]
Advanced

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

[Bug-tar] bugs caught by -Wall


From: Eric Blake
Subject: [Bug-tar] bugs caught by -Wall
Date: Thu, 08 Dec 2005 21:33:16 -0700
User-agent: Mozilla Thunderbird 1.0.2 (Windows/20050317)

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

There are several bugs that the compiler wants to warn you about, by
compiling with -Wall:

if gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../lib -I../ -I../lib     -g2 -Wall
- -Werror -MT buffer.o -MD -MP -MF ".deps/buffer.Tpo" -c -o buffer.o
buffer.c; \
then mv -f ".deps/buffer.Tpo" ".deps/buffer.Po"; else rm -f
".deps/buffer.Tpo"; exit 1; fi
buffer.c: In function `open_archive':
buffer.c:1621: warning: enumeration value `ACCESS_UPDATE' not handled in
switch

if gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../lib -I../ -I../lib     -g2 -Wall
- -Werror -MT compare.o -MD -MP -MF ".deps/compare.Tpo" -c -o compare.o
compare.c; \
then mv -f ".deps/compare.Tpo" ".deps/compare.Po"; else rm -f
".deps/compare.Tpo"; exit 1; fi
compare.c: In function `diff_file':
compare.c:265: warning: implicit declaration of function `set_file_atime'

if gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../lib -I../ -I../lib     -g2 -Wall
- -Werror -MT create.o -MD -MP -MF ".deps/create.Tpo" -c -o create.o
create.c; \
then mv -f ".deps/create.Tpo" ".deps/create.Po"; else rm -f
".deps/create.Tpo"; exit 1; fi
create.c: In function `to_chars_subst':
create.c:131: warning: unused variable `p'

if gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../lib -I../ -I../lib     -g2 -Wall
- -Werror -MT create.o -MD -MP -MF ".deps/create.Tpo" -c -o create.o
create.c; \
then mv -f ".deps/create.Tpo" ".deps/create.Po"; else rm -f
".deps/create.Tpo"; exit 1; fi
create.c: In function `to_chars_subst':
create.c:170: warning: control reaches end of non-void function

if gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../lib -I../ -I../lib     -g2 -Wall
- -Werror -MT incremen.o -MD -MP -MF ".deps/incremen.Tpo" -c -o incremen.o
incremen.c; \
then mv -f ".deps/incremen.Tpo" ".deps/incremen.Po"; else rm -f
".deps/incremen.Tpo"; exit 1; fi
incremen.c: In function `read_directory_file':
incremen.c:457: warning: format argument is not a pointer (arg 4)

This patch only fixes a couple of the warnings.

2005-12-08  Eric Blake  <address@hidden>

        * src/common.h (set_file_name): Add prototype.
        * src/incremen.c (read_directory_file): Fix printf format.

- --
Life is short - so eat dessert first!

Eric Blake             address@hidden
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFDmQkL84KuGfSFAYARAvoTAKDP7gZvnc83TnIOr7BUgO35DqldugCeITy3
Ij03MQcFDpoB3HZ+/hnbWfw=
=hac9
-----END PGP SIGNATURE-----
Index: src/common.h
===================================================================
RCS file: /cvsroot/tar/tar/src/common.h,v
retrieving revision 1.71
diff -u -p -b -r1.71 common.h
--- src/common.h        8 Dec 2005 15:41:11 -0000       1.71
+++ src/common.h        9 Dec 2005 04:32:52 -0000
@@ -549,6 +549,7 @@ bool maybe_backup_file (const char *, in
 void undo_last_backup (void);
 
 int deref_stat (bool, char const *, struct stat *);
+int set_file_atime (int, char const *, struct timespec const[2]);
 
 int chdir_arg (char const *);
 void chdir_do (int);
Index: src/incremen.c
===================================================================
RCS file: /cvsroot/tar/tar/src/incremen.c,v
retrieving revision 1.36
diff -u -p -b -r1.36 incremen.c
--- src/incremen.c      1 Dec 2005 12:51:20 -0000       1.36
+++ src/incremen.c      9 Dec 2005 04:32:52 -0000
@@ -454,7 +454,7 @@ read_directory_file (void)
        incremental_version = 0;
 
       if (incremental_version > TAR_INCREMENTAL_VERSION)
-       ERROR((1, 0, _("Unsupported incremental format version: %s"),
+       ERROR((1, 0, _("Unsupported incremental format version: %d"),
               incremental_version));
       
       t = u = (errno = 0, strtoumax (buf, &ebuf, 10));

reply via email to

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