From 8ad1b31305297df63a04919ad1bd9b94dec9aeb4 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Sun, 14 Sep 2014 19:38:11 -0700 Subject: maint: enable sc_program_name syntax check * cfg.mk (local-checks-to-skip): Remove its exemption. * sed/sed.c: Include progname.h". (program_name): Remove now-unnecessary declaration. (main): Call set_program_name. * bootstrap.conf (gnulib_modules): Add progname. * lib/.gitignore: Append the two new names. --- bootstrap.conf | 1 + cfg.mk | 3 ++- lib/.gitignore | 2 ++ sed/sed.c | 4 ++-- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/bootstrap.conf b/bootstrap.conf index 2cc519e..a51fd5f 100644 --- a/bootstrap.conf +++ b/bootstrap.conf @@ -40,6 +40,7 @@ mbsinit memchr mkostemp obstack +progname readme-release regex rename diff --git a/cfg.mk b/cfg.mk index 6f5e520..f381309 100644 --- a/cfg.mk +++ b/cfg.mk @@ -33,7 +33,6 @@ local-checks-to-skip = \ sc_m4_quote_check \ sc_makefile_at_at_check \ sc_po_check \ - sc_program_name \ sc_prohibit_always_true_header_tests \ sc_prohibit_atoi_atof \ sc_prohibit_empty_lines_at_EOF \ @@ -139,3 +138,5 @@ config_h_header ?= (|"sed\.h") exclude_file_name_regexp--sc_long_lines = ^tests/.*$$ exclude_file_name_regexp--sc_prohibit_doubled_word = \ ^testsuite/(mac-mf|uniq)\.(good|inp)$$ + +exclude_file_name_regexp--sc_program_name = ^testsuite/.*\.c$$ diff --git a/lib/.gitignore b/lib/.gitignore index 48d8e10..95015bc 100644 --- a/lib/.gitignore +++ b/lib/.gitignore @@ -206,3 +206,5 @@ xstriconv.c xstriconv.h xstrndup.c xstrndup.h +/progname.c +/progname.h diff --git a/sed/sed.c b/sed/sed.c index 511f03a..71713ac 100644 --- a/sed/sed.c +++ b/sed/sed.c @@ -26,6 +26,7 @@ #include #include #include "getopt.h" +#include "progname.h" #include "version-etc.h" @@ -35,8 +36,6 @@ _("Ken Pizzini"), \ _("Paolo Bonzini") -char *program_name; - int extended_regexp_flags = 0; /* one-byte buffer delimiter */ @@ -200,6 +199,7 @@ main(argc, argv) /* Set locale according to user's wishes. */ setlocale (LC_ALL, ""); #endif + set_program_name (argv[0]); initialize_mbcs (); #if ENABLE_NLS -- cgit v1.2.1