* NEWS: Version 2.0b.

* data/glr.c (ATTRIBUTE_UNUSED): Remove, since it infringes on
the user's name space.  All uses changed to __attribute__
((__unused__)).
(yyFail, yyMemoryExhausted, yyreportAmbiguity):
Add __attribute__ ((__noreturn__)).

* etc/clcommit: Remove.  We weren't using it, and it failed
"make maintainer-distcheck".
* Makefile.maint: Merge from coreutils.
(CVS_LIST, CVS_LIST_EXCEPT): New macros.
(syntax-check-rules): Change list of rules as described below.
(sc_cast_of_alloca_return_value, sc_dd_max_sym_length):
(sc_file_system, sc_obsolete_symbols, sc_prohibit_atoi_atof):
(sc_prohibit_jm_in_m4, sc_root_tests, sc_tight_scope):
(sc_trailing_space): New rules.
(sc_xalloc_h_in_src): Remove.
(sc_cast_of_argument_to_free, sc_cast_of_x_alloc_return_value):
(sc_space_tab, sc_error_exit_success, sc_changelog):
(sc_system_h_headers, sc_sun_os_names, sc_unmarked_diagnostics):
(makefile-check, po-check, author_mark_check):
(makefile_path_separator_check, copyright-check):
Use grep -n, to make it easier to find violations.
Use CVS_LIST and CVS_LIST_EXCEPT.
(header_regexp, h_re): Remove.
(dd_c): New macro.
(sc_dd_max_sym_length, .re-list, news-date-check): New rules.
(my-distcheck): Use more-modern GCC flags.
(signatures, %.asc): Remove.
(rel-files, announcement): Remove signatures.
Restore old updating code, even though we don't use it, so
that we're the same as coreutils.
(alpha, beta, major): Depend on news-date-check.
Make the upload commands.

* data/c.m4, data/lalr1.cc, data/yacc.c: Normalize white space.
* lib/abitset.h, lib/bbitset.h, lib/bitset.h: Likewise.
* lib/bitset_stats.c, lib/ebitset.h, lib/lbitset.c: Likewise.
* lib/libitset.h, lib/timevar.c, lib/vbitset.h: Likewise.
* src/Makefile.am, src/gram.c, src/muscle_tab.h: Likewise.
* src/parse-gram.y, src/system.h, src/tables.c, src/vcg.c: Likewise.
* src/vcg_defaults.h, tests/cxx-type.at, tests/existing.at: Likewise.
* tests/sets.at: Likewise.

* data/m4sugar/m4sugar.m4: Sync from Autoconf, except that
we comment out the Autoconf version number.
* doc/bison.texinfo (Calc++ Scanner): Don't use atoi, as
it's error-prone and "make maintainer-distcheck" rejects it.

* lib/subpipe.c: Include <fcntl.h> without checking for HAVE_FCNTL_H.
Indent calls to "error" to pacify "make maintainer-distcheck",
when the calls are not intended to be translated.
* m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't check for fcntl.h.

* src/Makefile.am (DEFS): Use +=, to pacify
"make maintainer-distcheck".
(bison_SOURCES): Add scan-skel.h.
(sc_tight_scope): New rule, from coreutils.

* src/files.c (src_extension, header_extension):
Now static, not extern.
* src/getargs.c (short_options): Likewise.
* src/muscle_tab.c (muscle_table): Likewise.
* src/parse-gram.y (current_class, current_type, current_prec):
Likewise.
* src/reader.c (grammar_end, previous_rule_end): Likewise.
* src/getargs.h: Redo comments to pacify "make maintainer-distcheck".
* src/main.c (main): Cast bindtextdomain and textdomain calls to
void, to avoid warning when NLS is disabled.
* src/output.c: Include scan-skel.h.
(scan_skel): Remove decl, since scan-skel.h does this.
(output_skeleton):
Indent calls to "error" to pacify "make maintainer-distcheck".
* src/print_graph.c: Don't include <obstack.h>, as system.h does this.
* src/reader.h (gram_end, gram_lineno): New decls to pacify
"make maintainer-distcheck".
* src/scan-skel.l (skel_lex, skel_get_lineno, skel_get_in):
(skel_get_out, skel_get_leng, skel_get_text, skel_set_lineno):
(skel_set_in, skel_set_out, skel_get_debug, skel_set_debug):
(skel_lex_destroy, scan_skel): Move these decls to...
* src/scan-skel.h: New file.
* src/uniqstr.c (uniqstr_assert):
Indent calls to "error" to pacify "make maintainer-distcheck".

* tests/Makefile.am ($(srcdir)/package.m4): Use $(VAR),
not @VAR@.

* tests/torture.at: Revamp to avoid misuse of atoi that
"make maintainer-distcheck" complained about.
This commit is contained in:
Paul Eggert
2005-07-24 07:24:22 +00:00
parent 135bc829bd
commit 040984073a
46 changed files with 1008 additions and 1026 deletions

View File

@@ -15,9 +15,7 @@
## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
## 02110-1301 USA
DEFS = @DEFS@ \
-DPKGDATADIR=\"$(pkgdatadir)\" \
-DLOCALEDIR=\"$(datadir)/locale\"
DEFS += -DPKGDATADIR=\"$(pkgdatadir)\" -DLOCALEDIR=\"$(datadir)/locale\"
AM_CFLAGS = $(WARNING_CFLAGS) $(WERROR_CFLAGS)
AM_CPPFLAGS = -I$(top_srcdir)/lib -I../lib
@@ -33,7 +31,7 @@ bin_PROGRAMS = bison
bin_SCRIPTS = $(YACC_SCRIPT)
EXTRA_SCRIPTS = yacc
bison_SOURCES = \
bison_SOURCES = \
LR0.c LR0.h \
assoc.c assoc.h \
closure.c closure.h \
@@ -56,7 +54,7 @@ bison_SOURCES = \
reduce.c reduce.h \
relation.c relation.h \
scan-gram.l \
scan-skel.l \
scan-skel.h scan-skel.l \
state.c state.h \
symlist.c symlist.h \
symtab.c symtab.h \
@@ -77,3 +75,34 @@ yacc:
echo:
echo $(bison_SOURCES) $(noinst_HEADERS)
# The following rule is not designed to be portable,
# and relies on tools that not everyone has.
# Most functions in src/*.c should have static scope.
# Any that don't must be marked with `extern', but `main'
# and `usage' are exceptions. They're always extern, but
# don't need to be marked.
#
# The second nm|grep checks for file-scope variables with `extern' scope.
sc_tight_scope: $(all_programs)
@t=exceptions-$$$$; \
trap 's=$$?; rm -f $$t; exit $$s' 0 1 2 13 15; \
( printf '^main$$\n^usage$$\n'; \
grep -h -A1 '^extern .*[^;]$$' $(SOURCES) \
| grep -vE '^(extern |--)' |sed 's/^/^/;s/ .*/$$/' ) > $$t; \
if nm -e *.$(OBJEXT) \
| sed -n 's/.* T //p' \
| grep -Ev -f $$t; then \
echo 'the above functions should have static scope' 1>&2; \
exit 1; \
fi; \
( printf '^program_name$$\n'; \
sed -n 's/^extern .*[* ]\([a-zA-Z_][a-zA-Z_0-9]*\);$$/^\1$$/p' \
$$(ls $(SOURCES) | grep '\.h$$') /dev/null) > $$t; \
if nm -e *.$(OBJEXT) \
| sed -n 's/.* [BD] //p' \
| grep -Ev -f $$t; then \
echo 'the above variables should have static scope' 1>&2; \
exit 1; \
fi

View File

@@ -66,9 +66,9 @@ static char *full_base_name = NULL;
char *short_base_name = NULL;
/* C source file extension (the parser source). */
const char *src_extension = NULL;
static char const *src_extension = NULL;
/* Header file extension (if option ``-d'' is specified). */
const char *header_extension = NULL;
static char const *header_extension = NULL;
/*-----------------------------------------------------------------.
| Return a newly allocated string composed of the concatenation of |

View File

@@ -285,7 +285,7 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\
`----------------------*/
/* Shorts options. */
const char *short_options = "yvegdhr:ltknVo:b:p:S:T::";
static char const short_options[] = "yvegdhr:ltknVo:b:p:S:T::";
/* Values for long options that do not have single-letter equivalents. */
enum

View File

@@ -1,5 +1,5 @@
/* Parse command line arguments for bison.
Copyright (C) 1984, 1986, 1989, 1992, 2000, 2001, 2002, 2003, 2004
Copyright (C) 1984, 1986, 1989, 1992, 2000, 2001, 2002, 2003, 2004, 2005
Free Software Foundation, Inc.
This file is part of Bison, the GNU Compiler Compiler.
@@ -23,8 +23,12 @@
# define GETARGS_H_
/* flags set by % directives */
extern const char *skeleton; /* for -S */
extern const char *include; /* for -I */
/* for -S */
extern char const *skeleton;
/* for -I */
extern char const *include;
extern bool debug_flag; /* for -t */
extern bool defines_flag; /* for -d */

View File

@@ -269,7 +269,7 @@ grammar_dump (FILE *out, const char *title)
rule *rule_i = &rules[i];
item_number *rp = NULL;
unsigned int rhs_itemno = rule_i->rhs - ritem;
unsigned int rhs_count = 0;
unsigned int rhs_count = 0;
/* Find the last RHS index in ritems. */
for (rp = rule_i->rhs; *rp >= 0; ++rp)
++rhs_count;

View File

@@ -56,9 +56,9 @@ main (int argc, char *argv[])
{
program_name = argv[0];
setlocale (LC_ALL, "");
bindtextdomain (PACKAGE, LOCALEDIR);
bindtextdomain ("bison-runtime", LOCALEDIR);
textdomain (PACKAGE);
(void) bindtextdomain (PACKAGE, LOCALEDIR);
(void) bindtextdomain ("bison-runtime", LOCALEDIR);
(void) textdomain (PACKAGE);
uniqstrs_new ();

View File

@@ -41,7 +41,7 @@ struct obstack muscle_obstack;
/* Initial capacity of muscles hash table. */
#define HT_INITIAL_CAPACITY 257
struct hash_table *muscle_table = NULL;
static struct hash_table *muscle_table = NULL;
static bool
hash_compare_muscles (void const *x, void const *y)

View File

@@ -40,14 +40,14 @@ extern struct obstack muscle_obstack;
#define MUSCLE_INSERT_INT(Key, Value) \
{ \
obstack_fgrow1 (&muscle_obstack, "%d", Value); \
obstack_fgrow1 (&muscle_obstack, "%d", Value); \
obstack_1grow (&muscle_obstack, 0); \
muscle_insert (Key, obstack_finish (&muscle_obstack)); \
}
#define MUSCLE_INSERT_LONG_INT(Key, Value) \
{ \
obstack_fgrow1 (&muscle_obstack, "%ld", Value); \
obstack_fgrow1 (&muscle_obstack, "%ld", Value); \
obstack_1grow (&muscle_obstack, 0); \
muscle_insert (Key, obstack_finish (&muscle_obstack)); \
}

View File

@@ -36,12 +36,10 @@
#include "muscle_tab.h"
#include "output.h"
#include "reader.h"
#include "scan-skel.h"
#include "symtab.h"
#include "tables.h"
/* From src/scan-skel.l. */
void scan_skel (FILE *);
static struct obstack format_obstack;
@@ -559,7 +557,8 @@ output_skeleton (void)
out = fdopen (filter_fd[0], "w");
if (! out)
error (EXIT_FAILURE, get_errno (), "fdopen");
error (EXIT_FAILURE, get_errno (),
"fdopen");
/* Output the definitions of all the muscles. */
fputs ("m4_init()\n", out);
@@ -580,7 +579,8 @@ output_skeleton (void)
timevar_push (TV_M4);
in = fdopen (filter_fd[1], "r");
if (! in)
error (EXIT_FAILURE, get_errno (), "fdopen");
error (EXIT_FAILURE, get_errno (),
"fdopen");
scan_skel (in);
xfclose (in);
reap_subpipe (pid, m4);

View File

@@ -48,12 +48,12 @@ static void gram_error (location const *, char const *);
static void add_param (char const *, char *, location);
symbol_class current_class = unknown_sym;
uniqstr current_type = 0;
static symbol_class current_class = unknown_sym;
static uniqstr current_type = 0;
symbol *current_lhs;
location current_lhs_location;
assoc current_assoc;
int current_prec = 0;
static int current_prec = 0;
%}
%debug
@@ -206,7 +206,7 @@ declaration:
| "%defines" { defines_flag = true; }
| "%error-verbose" { error_verbose = true; }
| "%expect" INT { expected_sr_conflicts = $2; }
| "%expect-rr" INT { expected_rr_conflicts = $2; }
| "%expect-rr" INT { expected_rr_conflicts = $2; }
| "%file-prefix" "=" string_content { spec_file_prefix = $3; }
| "%glr-parser"
{
@@ -221,7 +221,7 @@ declaration:
| "%locations" { locations_flag = true; }
| "%name-prefix" "=" string_content { spec_name_prefix = $3; }
| "%no-lines" { no_lines_flag = true; }
| "%nondeterministic-parser" { nondeterministic_parser = true; }
| "%nondeterministic-parser" { nondeterministic_parser = true; }
| "%output" "=" string_content { spec_outfile = $3; }
| "%parse-param {...}" { add_param ("parse_param", $1, @1); }
| "%pure-parser" { pure_parser = true; }

View File

@@ -1,6 +1,6 @@
/* Output a VCG description on generated parser, for Bison,
Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
This file is part of Bison, the GNU Compiler Compiler.
@@ -21,7 +21,6 @@
#include "system.h"
#include <obstack.h>
#include <quotearg.h>
#include "LR0.h"

View File

@@ -159,7 +159,7 @@ free_merger_functions (void)
`-------------------------------------------------------------------*/
/* The (currently) last symbol of GRAMMAR. */
symbol_list *grammar_end = NULL;
static symbol_list *grammar_end = NULL;
/* Append SYM to the grammar. */
void
@@ -179,7 +179,7 @@ grammar_symbol_append (symbol *sym, location loc)
CURRENT_RULE points to the first LHS of the current rule, while
PREVIOUS_RULE_END points to the *end* of the previous rule (NULL). */
symbol_list *current_rule = NULL;
symbol_list *previous_rule_end = NULL;
static symbol_list *previous_rule_end = NULL;
/*----------------------------------------------.

View File

@@ -43,6 +43,11 @@ void scanner_initialize (void);
void scanner_free (void);
void scanner_last_string_free (void);
/* These are declared by the scanner, but not used. We put them here
to pacify "make syntax-check". */
extern FILE *gram_out;
extern int gram_lineno;
# define YY_DECL int gram_lex (YYSTYPE *val, location *loc)
YY_DECL;

41
src/scan-skel.h Normal file
View File

@@ -0,0 +1,41 @@
/* Scan Bison Skeletons.
Copyright (C) 2005 Free Software Foundation, Inc.
This file is part of Bison, the GNU Compiler Compiler.
Bison is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
Bison is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Bison; see the file COPYING. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA. */
void scan_skel (FILE *);
/* Pacify "make syntax-check". */
extern FILE *skel_in;
extern FILE *skel_out;
extern int skel__flex_debug;
extern int skel_lineno;
/* Pacify "gcc -Wmissing-prototypes" when flex 2.5.31 is used. */
int skel_get_lineno (void);
FILE *skel_get_in (void);
FILE *skel_get_out (void);
int skel_get_leng (void);
char *skel_get_text (void);
void skel_set_lineno (int);
void skel_set_in (FILE *);
void skel_set_out (FILE *);
int skel_get_debug (void);
void skel_set_debug (int);
int skel_lex_destroy (void);

View File

@@ -31,21 +31,7 @@
#include "complain.h"
#include "getargs.h"
#include "files.h"
int skel_lex (void);
/* Pacify "gcc -Wmissing-prototypes" when flex 2.5.31 is used. */
int skel_get_lineno (void);
FILE *skel_get_in (void);
FILE *skel_get_out (void);
int skel_get_leng (void);
char *skel_get_text (void);
void skel_set_lineno (int);
void skel_set_in (FILE *);
void skel_set_out (FILE *);
int skel_get_debug (void);
void skel_set_debug (int);
int skel_lex_destroy (void);
#include "scan-skel.h"
#define QPUTS(String) \
fputs (quotearg_style (c_quoting_style, (String)), yyout)
@@ -110,8 +96,6 @@ int skel_lex_destroy (void);
| Scan a Bison skeleton. |
`------------------------*/
void scan_skel (FILE *);
void
scan_skel (FILE *in)
{

View File

@@ -130,9 +130,9 @@ typedef size_t uintptr_t;
| Obstacks. |
`-----------*/
# define obstack_chunk_alloc xmalloc
# define obstack_chunk_free free
# include <obstack.h>
#define obstack_chunk_alloc xmalloc
#define obstack_chunk_free free
#include <obstack.h>
#define obstack_sgrow(Obs, Str) \
obstack_grow (Obs, Str, strlen (Str))

View File

@@ -173,7 +173,7 @@ table_grow (int desired)
/*-------------------------------------------------------------------.
| For GLR parsers, for each conflicted token in S, as indicated |
| by non-zero entries in CONFLROW, create a list of possible |
| by non-zero entries in CONFLROW, create a list of possible |
| reductions that are alternatives to the shift or reduction |
| currently recorded for that token in S. Store the alternative |
| reductions followed by a 0 in CONFLICT_LIST, updating |

View File

@@ -1,6 +1,6 @@
/* Keep a unique copy of strings.
Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
This file is part of Bison, the GNU Compiler Compiler.
@@ -63,7 +63,8 @@ uniqstr_assert (char const *str)
{
if (!hash_lookup (uniqstrs_table, str))
{
error (0, 0, "not a uniqstr: %s", quotearg (str));
error (0, 0,
"not a uniqstr: %s", quotearg (str));
abort ();
}
}

View File

@@ -203,7 +203,7 @@ new_edge (edge *e)
}
/*----------------------------------------------.
| Get functions. |
| Get functions. |
| Return string corresponding to an enum value. |
`----------------------------------------------*/
@@ -374,7 +374,7 @@ get_arrowstyle_str (enum arrowstyle arrowstyle)
}
/*------------------------------.
| Add functions. |
| Add functions. |
| Edge and nodes into a graph. |
`------------------------------*/

View File

@@ -48,11 +48,11 @@
# define G_TEXTMODE centered
# define G_SHAPE box
# define G_VERTICAL_ORDER 0 /* Unspecified for subgraphs. */
# define G_HORIZONTAL_ORDER 0 /* Unspecified for subgraphs. */
# define G_VERTICAL_ORDER 0 /* Unspecified for subgraphs. */
# define G_HORIZONTAL_ORDER 0 /* Unspecified for subgraphs. */
# define G_XMAX 90 /* Not output */
# define G_YMAX 90 /* Not output */
# define G_XMAX 90 /* Not output. */
# define G_YMAX 90 /* Not output. */
# define G_XBASE 5
# define G_YBASE 5
@@ -65,9 +65,9 @@
# define G_YRASTER 1
# define G_XLRASTER 1
# define G_HIDDEN (-1) /* No default value. */
# define G_HIDDEN (-1) /* No default value. */
# define G_CLASSNAME NULL /* No class name association */
# define G_CLASSNAME NULL /* No class name association. */
# define G_INFONAME NULL
# define G_COLORENTRY NULL