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:
12
src/system.c
12
src/system.c
@@ -722,8 +722,8 @@ sys_exec_command (char *file_name, int typechar, struct tar_stat_info *st)
|
||||
|
||||
stat_to_env (file_name, typechar, st);
|
||||
|
||||
argv[0] = "/bin/sh";
|
||||
argv[1] = "-c";
|
||||
argv[0] = (char *) "/bin/sh";
|
||||
argv[1] = (char *) "-c";
|
||||
argv[2] = to_command_option;
|
||||
argv[3] = NULL;
|
||||
|
||||
@@ -837,8 +837,8 @@ sys_exec_info_script (const char **archive_name, int volume_number)
|
||||
|
||||
xclose (p[PREAD]);
|
||||
|
||||
argv[0] = "/bin/sh";
|
||||
argv[1] = "-c";
|
||||
argv[0] = (char *) "/bin/sh";
|
||||
argv[1] = (char *) "-c";
|
||||
argv[2] = (char *) info_script_option;
|
||||
argv[3] = NULL;
|
||||
|
||||
@@ -885,8 +885,8 @@ sys_exec_checkpoint_script (const char *script_name,
|
||||
setenv ("TAR_FORMAT",
|
||||
archive_format_string (current_format == DEFAULT_FORMAT ?
|
||||
archive_format : current_format), 1);
|
||||
argv[0] = "/bin/sh";
|
||||
argv[1] = "-c";
|
||||
argv[0] = (char *) "/bin/sh";
|
||||
argv[1] = (char *) "-c";
|
||||
argv[2] = (char *) script_name;
|
||||
argv[3] = NULL;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user