Merge remote-tracking branch 'origin/maint'
authorAkim Demaille <akim@lrde.epita.fr>
Tue, 4 Sep 2012 16:51:55 +0000 (18:51 +0200)
committerAkim Demaille <akim@lrde.epita.fr>
Tue, 4 Sep 2012 16:51:55 +0000 (18:51 +0200)
* 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

1  2 
data/yacc.c
doc/.gitignore
src/getargs.c
src/parse-gram.c
src/parse-gram.y
src/scan-gram.l
src/system.h

diff --cc data/yacc.c
Simple merge
diff --cc 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
@@@ -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: "
+                "<http://www.gnu.org/gethelp/>.\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 <http://translationproject.org/team/LANG_CODE.html> 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 "
+                  "<http://translationproject.org/team/>.\n"), stdout);
+       fputs (_("For complete documentation, run: info bison.\n"), stdout);
      }
  
    exit (status);
@@@ -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));
@@@ -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
  #define gram_wrap() 1
  
  #define FLEX_PREFIX(Id) gram_ ## Id
 -#include "flex-scanner.h"
 +#include <src/flex-scanner.h>
  
 -#include "complain.h"
 -#include "files.h"
 -#include "gram.h"
 -#include "quotearg.h"
 -#include "reader.h"
 -#include "uniqstr.h"
 +#include <src/complain.h>
 +#include <src/files.h>
 +#include <src/gram.h>
 +#include <quotearg.h>
 +#include <src/reader.h>
 +#include <src/uniqstr.h>
  
- #include <ctype.h>
+ #include <c-ctype.h>
  #include <mbswidth.h>
  #include <quote.h>
  
@@@ -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
     runs afoul of pre-C99 compilers that have <inttypes.h> or
     <stdint.h>, which are included below if available.  It also runs
     afoul of pre-C99 compilers that define these macros in <limits.h>.  */
 -# 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 <limits.h>
 -# include <stddef.h>
 -# include <stdlib.h>
 -# include <string.h>
 -# include <unistd.h>
 -# include <inttypes.h>
 -
 -# 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 <limits.h>
 +#include <stddef.h>
 +#include <stdlib.h>
 +#include <string.h>
 +
 +#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 <sys/types.h>
- #endif
 +#include <unistd.h>
 +#include <inttypes.h>
 +
 +#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;
  
  /* 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.  |