From: Akim Demaille Date: Tue, 4 Sep 2012 16:51:55 +0000 (+0200) Subject: Merge remote-tracking branch 'origin/maint' X-Git-Tag: v2.7.90~338 X-Git-Url: https://git.saurik.com/bison.git/commitdiff_plain/6b5a748937ae95af26d78e9e5e7a335351a2970d Merge remote-tracking branch 'origin/maint' * origin/maint: maint: remove useless file update files to ignore remove useless include use locale-indep. c_is* functions for parsing, not isspace, isprint etc gnulib: update --help: include a place to report translation issues tests: style changes tests: fix push-pull test yacc.c: style changes Conflicts: src/system.h --- 6b5a748937ae95af26d78e9e5e7a335351a2970d diff --cc doc/.gitignore index 221cbd44,0fb0cca8..8abfdb94 --- a/doc/.gitignore +++ b/doc/.gitignore @@@ -1,14 -1,15 +1,14 @@@ - /*.info* /*~ /.dirstamp -/Makefile -/Makefile.in /bison.1 /bison.aux /bison.cp /bison.cps /bison.dvi /bison.fn +/bison.help /bison.html + /bison.info /bison.ky /bison.log /bison.pdf diff --cc src/getargs.c index d8a527d6,70a25e03..74be4101 --- a/src/getargs.c +++ b/src/getargs.c @@@ -344,7 -361,25 +344,25 @@@ THINGS is a list of comma separated wor `none' disable the report\n\ "), stdout); - printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT); + putc ('\n', stdout); + printf (_("Report bugs to <%s>.\n"), PACKAGE_BUGREPORT); + printf (_("%s home page: <%s>.\n"), PACKAGE_NAME, PACKAGE_URL); + fputs (_("General help using GNU software: " + ".\n"), + stdout); + /* Don't output this redundant message for English locales. + Note we still output for 'C' so that it gets included in the + man page. */ + const char *lc_messages = setlocale (LC_MESSAGES, NULL); - if (lc_messages && strcmp (lc_messages, "en_")) ++ if (lc_messages && !STREQ (lc_messages, "en_")) + /* TRANSLATORS: Replace LANG_CODE in this URL with your language + code to + form one of the URLs at http://translationproject.org/team/. + Otherwise, replace the entire URL with your translation team's + email address. */ + fputs (_("Report translation bugs to " + ".\n"), stdout); + fputs (_("For complete documentation, run: info bison.\n"), stdout); } exit (status); diff --cc src/parse-gram.c index 7a19cf18,037035bc..f92f659d --- a/src/parse-gram.c +++ b/src/parse-gram.c @@@ -3241,31 -3158,28 +3242,31 @@@ add_param (param_type type, char *decl "ABCDEFGHIJKLMNOPQRSTUVWXYZ" "_" "0123456789"; + char const *name_start = NULL; - char *p; - - /* Stop on last actual character. */ - for (p = decl; p[1]; p++) - if ((p == decl - || ! memchr (alphanum, p[-1], sizeof alphanum)) - && memchr (alphanum, p[0], sizeof alphanum - 10)) - name_start = p; - - /* Strip the surrounding '{' and '}', and any blanks just inside - the braces. */ - --p; - while (c_isspace ((unsigned char) *p)) + { + char *p; + /* Stop on last actual character. */ + for (p = decl; p[1]; p++) + if ((p == decl + || ! memchr (alphanum, p[-1], sizeof alphanum)) + && memchr (alphanum, p[0], sizeof alphanum - 10)) + name_start = p; + + /* Strip the surrounding '{' and '}', and any blanks just inside + the braces. */ --p; - while (isspace ((unsigned char) *p)) - p[1] = '\0'; - ++decl; - while (c_isspace ((unsigned char) *decl)) ++ while (c_isspace ((unsigned char) *p)) + --p; + p[1] = '\0'; ++decl; - while (isspace ((unsigned char) *decl)) ++ while (c_isspace ((unsigned char) *decl)) + ++decl; + } if (! name_start) - complain_at (loc, _("missing identifier in parameter declaration")); + complain_at (loc, complaint, + _("missing identifier in parameter declaration")); else { char *name = xmemdup0 (name_start, strspn (name_start, alphanum)); diff --cc src/parse-gram.y index 016963a8,3120bfc2..46500db0 --- a/src/parse-gram.y +++ b/src/parse-gram.y @@@ -762,31 -723,28 +763,31 @@@ add_param (param_type type, char *decl "ABCDEFGHIJKLMNOPQRSTUVWXYZ" "_" "0123456789"; + char const *name_start = NULL; - char *p; - - /* Stop on last actual character. */ - for (p = decl; p[1]; p++) - if ((p == decl - || ! memchr (alphanum, p[-1], sizeof alphanum)) - && memchr (alphanum, p[0], sizeof alphanum - 10)) - name_start = p; - - /* Strip the surrounding '{' and '}', and any blanks just inside - the braces. */ - --p; - while (c_isspace ((unsigned char) *p)) + { + char *p; + /* Stop on last actual character. */ + for (p = decl; p[1]; p++) + if ((p == decl + || ! memchr (alphanum, p[-1], sizeof alphanum)) + && memchr (alphanum, p[0], sizeof alphanum - 10)) + name_start = p; + + /* Strip the surrounding '{' and '}', and any blanks just inside + the braces. */ --p; - while (isspace ((unsigned char) *p)) - p[1] = '\0'; - ++decl; - while (c_isspace ((unsigned char) *decl)) ++ while (c_isspace ((unsigned char) *p)) + --p; + p[1] = '\0'; ++decl; - while (isspace ((unsigned char) *decl)) ++ while (c_isspace ((unsigned char) *decl)) + ++decl; + } if (! name_start) - complain_at (loc, _("missing identifier in parameter declaration")); + complain_at (loc, complaint, + _("missing identifier in parameter declaration")); else { char *name = xmemdup0 (name_start, strspn (name_start, alphanum)); diff --cc src/scan-gram.l index 084796c4,dbea2a1d..2275d022 --- a/src/scan-gram.l +++ b/src/scan-gram.l @@@ -27,16 -27,16 +27,16 @@@ #define gram_wrap() 1 #define FLEX_PREFIX(Id) gram_ ## Id -#include "flex-scanner.h" +#include -#include "complain.h" -#include "files.h" -#include "gram.h" -#include "quotearg.h" -#include "reader.h" -#include "uniqstr.h" +#include +#include +#include +#include +#include +#include - #include + #include #include #include @@@ -634,10 -557,10 +634,10 @@@ splice (\\[ \f\t\v]*\n) else obstack_1grow (&obstack_for_string, c); } - \\(.|\n) { + \\(.|\n) { char const *p = yytext + 1; /* Quote only if escaping won't make the character visible. */ - if (isspace ((unsigned char) *p) && isprint ((unsigned char) *p)) + if (c_isspace ((unsigned char) *p) && c_isprint ((unsigned char) *p)) p = quote (p); else p = quotearg_style_mem (escape_quoting_style, p, 1); diff --cc src/system.h index eba7845e,bf7f59f9..0395a0c0 --- a/src/system.h +++ b/src/system.h @@@ -22,44 -22,26 +22,40 @@@ runs afoul of pre-C99 compilers that have or , which are included below if available. It also runs afoul of pre-C99 compilers that define these macros in . */ -# if ! defined __STDC_VERSION__ || __STDC_VERSION__ < 199901 -# undef INT8_MIN -# undef INT16_MIN -# undef INT32_MIN -# undef INT8_MAX -# undef INT16_MAX -# undef UINT8_MAX -# undef INT32_MAX -# undef UINT16_MAX -# undef UINT32_MAX -# endif - -# include -# include -# include -# include -# include -# include - -# ifndef UINTPTR_MAX +#if ! defined __STDC_VERSION__ || __STDC_VERSION__ < 199901 +# undef INT8_MIN +# undef INT16_MIN +# undef INT32_MIN +# undef INT8_MAX +# undef INT16_MAX +# undef UINT8_MAX +# undef INT32_MAX +# undef UINT16_MAX +# undef UINT32_MAX +#endif + +#include +#include +#include +#include + +#define ARRAY_CARDINALITY(Array) (sizeof (Array) / sizeof *(Array)) +#define STREQ(L, R) (strcmp(L, R) == 0) +#define STRNEQ(L, R) (!STREQ(L, R)) + +/* Just like strncmp, but the second argument must be a literal string + and you don't specify the length. */ +#define STRNCMP_LIT(S, Literal) \ + strncmp (S, "" Literal "", sizeof (Literal) - 1) + +/* Whether Literal is a prefix of S. */ +#define STRPREFIX_LIT(Literal, S) \ + (STRNCMP_LIT (S, Literal) == 0) + - #if HAVE_SYS_TYPES_H - # include - #endif - +#include +#include + +#ifndef UINTPTR_MAX /* This isn't perfect, but it's good enough for Bison, which needs only to hash pointers. */ typedef size_t uintptr_t; @@@ -105,20 -87,19 +101,19 @@@ /* The __-protected variants of `format' and `printf' attributes are accepted by gcc versions 2.6.4 (effectively 2.7) and later. */ -# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7) -# define __format__ format -# define __printf__ printf -# endif +#if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7) +# define __format__ format +# define __printf__ printf +#endif -# ifndef ATTRIBUTE_NORETURN -# define ATTRIBUTE_NORETURN __attribute__ ((__noreturn__)) -# endif +#ifndef ATTRIBUTE_NORETURN +# define ATTRIBUTE_NORETURN __attribute__ ((__noreturn__)) +#endif -# ifndef ATTRIBUTE_UNUSED -# define ATTRIBUTE_UNUSED __attribute__ ((__unused__)) -# endif +#ifndef ATTRIBUTE_UNUSED +# define ATTRIBUTE_UNUSED __attribute__ ((__unused__)) +#endif - #define FUNCTION_PRINT() fprintf (stderr, "%s: ", __func__) /*------. | NLS. |