bison-patches
[Top][All Lists]
Advanced

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

Re: FYI: master: address some of the syntax-check errors


From: Akim Demaille
Subject: Re: FYI: master: address some of the syntax-check errors
Date: Sun, 19 Feb 2012 11:19:20 +0100

Le 18 févr. 2012 à 19:32, Akim Demaille a écrit :

> This is perfectly uninteresting work.  It's good that
> it's done though.  Will import to 2.5 too.

I don't understand the point of prohibit_HAVE_MBRTOWC:
our sole use in Bison comes from mbrtowc.m4 which comes
from gnulib.  So syntax-check complains about config.hin.
Is this really expected?  Am I missing something?

I hold the following patch for a while, in case someone
can help me with that issue.

From 36875fe05f7d41174b28843bd91ad58a07bec700 Mon Sep 17 00:00:00 2001
From: Akim Demaille <address@hidden>
Date: Sun, 19 Feb 2012 11:13:04 +0100
Subject: [PATCH] maint: address sc_bindtextdomain, sc_program_name and
 sc_prohibit_HAVE_MBRTOWC.

        * bootstrap.conf (gnulib_modules): Require progname.
        * src/complain.c, src/getargs.c, src/getargs.h, src/main.c: Use it.
        * cfg.mk (exclude): New.
        Use it.
        Skip lib/main.c for bindtextdomain and set_program_name.
        Skip config.hin for HAVE_MBRTOWC.
---
 bootstrap.conf |    3 ++-
 cfg.mk         |   18 ++++++++++--------
 lib/.gitignore |    2 ++
 src/complain.c |    1 +
 src/getargs.c  |    4 ++--
 src/getargs.h  |    1 -
 src/main.c     |    3 ++-
 7 files changed, 19 insertions(+), 13 deletions(-)

diff --git a/bootstrap.conf b/bootstrap.conf
index c8aac8d..cb3fc87 100644
--- a/bootstrap.conf
+++ b/bootstrap.conf
@@ -22,7 +22,8 @@ gnulib_modules='
   gettext git-version-gen gitlog-to-changelog
   gpl-3.0 hash inttypes isnan javacomp-script
   javaexec-script ldexpl maintainer-makefile malloc-gnu mbschr mbsrchr
-  mbswidth obstack perror pipe-posix quote quotearg realloc-posix
+  mbswidth obstack perror pipe-posix progname
+  quote quotearg realloc-posix
   spawn-pipe stdbool stpcpy strdup-posix strerror strtoul strverscmp
   sysexits
   unistd unistd-safer unlocked-io update-copyright unsetenv verify
diff --git a/cfg.mk b/cfg.mk
index 744fcf0..394e1fe 100644
--- a/cfg.mk
+++ b/cfg.mk
@@ -35,9 +35,6 @@ url_dir_list = \
 # Tests not to run as part of "make distcheck".
 local-checks-to-skip =                 \
   sc_immutable_NEWS                    \
-  sc_bindtextdomain                    \
-  sc_program_name                      \
-  sc_prohibit_HAVE_MBRTOWC             \
   sc_prohibit_always-defined_macros    \
   sc_prohibit_always_true_header_tests \
   sc_prohibit_atoi_atof                        \
@@ -58,8 +55,13 @@ update-copyright: update-b4-copyright 
update-package-copyright-year
 update-copyright-env = \
   UPDATE_COPYRIGHT_FORCE=1 UPDATE_COPYRIGHT_USE_INTERVALS=1
 
-exclude_file_name_regexp--sc_prohibit_empty_lines_at_EOF = ^src/parse-gram.h$$
-exclude_file_name_regexp--sc_require_config_h_first = \
-  ^(lib/yyerror|data/(glr|yacc))\.c$$
-exclude_file_name_regexp--sc_space_tab = ^tests/(input|c\+\+)\.at$$
-exclude_file_name_regexp--sc_unmarked_diagnostics = ^djgpp/
+exclude = $(foreach a,$(1),$(eval exclude_file_name_regexp--sc_$(a)))
+$(call exclude,                                                        \
+  bindtextdomain=^lib/main.c$$                                 \
+  program_name=^lib/main.c$$                                   \
+  prohibit_empty_lines_at_EOF=^src/parse-gram.h$$              \
+  prohibit_HAVE_MBRTOWC=^config\.hin$$                         \
+  require_config_h_first=^(lib/yyerror|data/(glr|yacc))\.c$$   \
+  space_tab=^tests/(input|c\+\+)\.at$$                         \
+  unmarked_diagnostics=^djgpp/                                 \
+)
diff --git a/lib/.gitignore b/lib/.gitignore
index 832cab8..c1c7c06 100644
--- a/lib/.gitignore
+++ b/lib/.gitignore
@@ -264,3 +264,5 @@
 /fpending.c
 /fpending.h
 /sysexits.in.h
+/progname.c
+/progname.h
diff --git a/src/complain.c b/src/complain.c
index 95e8a43..18432b4 100644
--- a/src/complain.c
+++ b/src/complain.c
@@ -23,6 +23,7 @@
 #include "system.h"
 
 #include <stdarg.h>
+#include <progname.h>
 
 #include "complain.h"
 #include "files.h"
diff --git a/src/getargs.c b/src/getargs.c
index e5d1faa..5e04ab0 100644
--- a/src/getargs.c
+++ b/src/getargs.c
@@ -40,6 +40,8 @@
 # undef HACK_FOR___GNU_LIBRARY___PROTOTYPE
 #endif
 
+#include <progname.h>
+
 #include "complain.h"
 #include "files.h"
 #include "getargs.h"
@@ -75,8 +77,6 @@ int language_prio = default_prio;
 struct bison_language const *language = &valid_languages[0];
 const char *include = NULL;
 
-char *program_name;
-
 
 /** Decode an option's set of keys.
  *
diff --git a/src/getargs.h b/src/getargs.h
index caef239..1d8c9d5 100644
--- a/src/getargs.h
+++ b/src/getargs.h
@@ -23,7 +23,6 @@
 
 #include "location.h"
 
-extern char *program_name;
 enum { command_line_prio, grammar_prio, default_prio };
 
 /* flags set by % directives */
diff --git a/src/main.c b/src/main.c
index 3dbac3a..fdb26ac 100644
--- a/src/main.c
+++ b/src/main.c
@@ -24,6 +24,7 @@
 #include <bitset_stats.h>
 #include <bitset.h>
 #include <configmake.h>
+#include <progname.h>
 #include <quotearg.h>
 #include <timevar.h>
 
@@ -57,7 +58,7 @@
 int
 main (int argc, char *argv[])
 {
-  program_name = argv[0];
+  set_program_name (argv[0]);
   setlocale (LC_ALL, "");
   (void) bindtextdomain (PACKAGE, LOCALEDIR);
   (void) bindtextdomain ("bison-runtime", LOCALEDIR);
-- 
1.7.9





reply via email to

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