build: new configure option --enable-gcc-warnings

This has a similar meaning as in other GNU applications
such as coreutils and Emacs.
* NEWS: Document it.
* .gitignore: Remove redundant build-aux.
Remove gnu, since gnu/Makefile.am is now in git.
Add gnu/.gitignore, gnu/charset.alias, gnu/*.h, gnu/*/ to cover
autogenerated files.
* bootstrap.conf (gnulib_mk): Remove.
* configure.ac: Add support for --enable-gcc-warnings,
taken from coreutils and simplified.
* gnu/Makefile.am: New file.  Formerly this was autogenerated,
but the autogenerated file has been renamed to gnulib.mk,
its usual name when bootstrapping from gnulib.
This way, AM_CFLAGS can incorporate warning options.
* gnulib.modules: Add manywarnings.
* lib/Makefile.am, src/Makefile.am (AM_CFLAGS): New macro,
incorporating warning options.
* lib/attr-xattr.in.h (ENOATTR): New macro, if not already defined.
* src/buffer.c (magic): Don't rely on incomplete initializers.
* src/common.h (report_difference): Add printf format attribute.
* src/system.c (sys_exec_command, sys_exec_info_script)
(sys_exec_checkpoint_script):
* src/tar.c (update_argv):
Add casts to char * to pacify GCC warnings about using string
literals in a char * context.
* src/xattrs.c, src/xattrs.h (xattrs_clear_setup):
Declare parameters as (void), not ().
* src/xheader.c (xheader_format_name): Initialize pptr to null,
to pacify GCC.  Remove unnecessary test of nptr versus null.
This commit is contained in:
Paul Eggert
2012-12-18 20:36:22 -08:00
parent 8c0146d2c9
commit cbc51277aa
16 changed files with 124 additions and 37 deletions

View File

@@ -27,6 +27,7 @@ rmt-command.h : Makefile
BUILT_SOURCES = rmt-command.h
CLEANFILES = rmt-command.h rmt-command.h-t
AM_CPPFLAGS = -I$(top_srcdir)/gnu -I../ -I../gnu
AM_CFLAGS = $(GNULIB_WARN_CFLAGS) $(WERROR_CFLAGS)
noinst_HEADERS = system.h system-ioctl.h rmt.h paxlib.h stdopen.h xattr-at.h
libtar_a_SOURCES = \
@@ -44,8 +45,8 @@ attr/xattr.h: attr-xattr.in.h $(top_builddir)/config.status
$(AM_V_at)$(MKDIR_P) attr
$(AM_V_GEN)rm -f $@-t $@ && \
cp $(srcdir)/attr-xattr.in.h attr/xattr.h
MOSTLYCLEANFILES = attr/xattr.h attr/xattr.h
endif
MOSTLYCLEANFILES = attr/xattr.h
EXTRA_DIST = attr-xattr.in.h

View File

@@ -17,6 +17,9 @@
#ifndef TAR_ATTR_XATTR_H
#define TAR_ATTR_XATTR_H
#include <errno.h>
#ifndef ENOATTR
# define ENOATTR ENODATA /* No such attribute */
#endif
/* setting */
static inline int setxattr (const char *path, const char *name, const void
@@ -55,4 +58,3 @@ static inline ssize_t flistxattr (int filedes, char *list, size_t size)
{ errno = ENOTSUP; return -1; }
#endif