Get Bison to build again when configured with --enable-gcc-warnings.

* src/location.c, src/location.h, src/main.c, src/scan-code.l: Add some
missing #include's.
* src/scan-code.l (handle_action_dollar, handle_action_at): Rename
loc argument as it shadows a global.
* src/scan-gram.l: Remove stray comma that prevents boundary_set
invocation.

* src/.cvsignore: Add scan-code.c.
This commit is contained in:
Joel E. Denny
2006-06-07 20:06:27 +00:00
parent 9f936c5e9c
commit 0c8e079fa6
7 changed files with 30 additions and 11 deletions

View File

@@ -1,3 +1,15 @@
2006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
Get Bison to build again when configured with --enable-gcc-warnings.
* src/location.c, src/location.h, src/main.c, src/scan-code.l: Add some
missing #include's.
* src/scan-code.l (handle_action_dollar, handle_action_at): Rename
loc argument as it shadows a global.
* src/scan-gram.l: Remove stray comma that prevents boundary_set
invocation.
* src/.cvsignore: Add scan-code.c.
2006-06-07 Akim Demaille <akim@epita.fr> 2006-06-07 Akim Demaille <akim@epita.fr>
* src/scan-gram.l: Move the "add a trailing ; to actions" code * src/scan-gram.l: Move the "add a trailing ; to actions" code

View File

@@ -6,6 +6,7 @@ Makefile
Makefile.in Makefile.in
bison bison
revision.c revision.c
scan-code.c
scan-gram.c scan-gram.c
scan-skel.c scan-skel.c
yacc yacc

View File

@@ -21,8 +21,10 @@
#include <config.h> #include <config.h>
#include "system.h" #include "system.h"
#include <mbswidth.h>
#include <quotearg.h> #include <quotearg.h>
#include "complain.h"
#include "location.h" #include "location.h"
location const empty_location; location const empty_location;

View File

@@ -21,6 +21,7 @@
#ifndef LOCATION_H_ #ifndef LOCATION_H_
# define LOCATION_H_ # define LOCATION_H_
# include <stdbool.h>
# include "uniqstr.h" # include "uniqstr.h"
/* A boundary between two characters. */ /* A boundary between two characters. */

View File

@@ -43,6 +43,7 @@
#include "print_graph.h" #include "print_graph.h"
#include "reader.h" #include "reader.h"
#include "reduce.h" #include "reduce.h"
#include "scan-gram.h"
#include "symtab.h" #include "symtab.h"
#include "tables.h" #include "tables.h"
#include "uniqstr.h" #include "uniqstr.h"

View File

@@ -30,6 +30,7 @@
#define code_wrap() 1 #define code_wrap() 1
#define FLEX_PREFIX(Id) code_ ## Id #define FLEX_PREFIX(Id) code_ ## Id
#include "complain.h"
#include "flex-scanner.h" #include "flex-scanner.h"
#include "reader.h" #include "reader.h"
#include "getargs.h" #include "getargs.h"
@@ -46,8 +47,8 @@ YY_DECL;
#define YY_USER_ACTION location_compute (loc, &loc->end, yytext, yyleng); #define YY_USER_ACTION location_compute (loc, &loc->end, yytext, yyleng);
static void handle_action_dollar (char *cp, location loc); static void handle_action_dollar (char *cp, location dollar_loc);
static void handle_action_at (char *cp, location loc); static void handle_action_at (char *cp, location at_loc);
static location the_location; static location the_location;
static location *loc = &the_location; static location *loc = &the_location;
@@ -234,7 +235,7 @@ int max_left_semantic_context = 0;
`------------------------------------------------------------------*/ `------------------------------------------------------------------*/
static void static void
handle_action_dollar (char *text, location loc) handle_action_dollar (char *text, location dollar_loc)
{ {
const char *type_name = NULL; const char *type_name = NULL;
char *cp = text + 1; char *cp = text + 1;
@@ -253,9 +254,9 @@ handle_action_dollar (char *text, location loc)
if (*cp == '$') if (*cp == '$')
{ {
if (!type_name) if (!type_name)
type_name = symbol_list_n_type_name_get (current_rule, loc, 0); type_name = symbol_list_n_type_name_get (current_rule, dollar_loc, 0);
if (!type_name && typed) if (!type_name && typed)
complain_at (loc, _("$$ of `%s' has no declared type"), complain_at (dollar_loc, _("$$ of `%s' has no declared type"),
current_rule->sym->tag); current_rule->sym->tag);
if (!type_name) if (!type_name)
type_name = ""; type_name = "";
@@ -274,9 +275,10 @@ handle_action_dollar (char *text, location loc)
if (1-n > max_left_semantic_context) if (1-n > max_left_semantic_context)
max_left_semantic_context = 1-n; max_left_semantic_context = 1-n;
if (!type_name && n > 0) if (!type_name && n > 0)
type_name = symbol_list_n_type_name_get (current_rule, loc, n); type_name =
symbol_list_n_type_name_get (current_rule, dollar_loc, n);
if (!type_name && typed) if (!type_name && typed)
complain_at (loc, _("$%d of `%s' has no declared type"), complain_at (dollar_loc, _("$%d of `%s' has no declared type"),
n, current_rule->sym->tag); n, current_rule->sym->tag);
if (!type_name) if (!type_name)
type_name = ""; type_name = "";
@@ -286,7 +288,7 @@ handle_action_dollar (char *text, location loc)
symbol_list_n_used_set (current_rule, n, true); symbol_list_n_used_set (current_rule, n, true);
} }
else else
complain_at (loc, _("integer out of range: %s"), quote (text)); complain_at (dollar_loc, _("integer out of range: %s"), quote (text));
} }
} }
@@ -297,7 +299,7 @@ handle_action_dollar (char *text, location loc)
`------------------------------------------------------*/ `------------------------------------------------------*/
static void static void
handle_action_at (char *text, location loc) handle_action_at (char *text, location at_loc)
{ {
char *cp = text + 1; char *cp = text + 1;
int rule_length = symbol_list_length (current_rule->next); int rule_length = symbol_list_length (current_rule->next);
@@ -318,7 +320,7 @@ handle_action_at (char *text, location loc)
rule_length, n); rule_length, n);
} }
else else
complain_at (loc, _("integer out of range: %s"), quote (text)); complain_at (at_loc, _("integer out of range: %s"), quote (text));
} }
} }

View File

@@ -751,7 +751,7 @@ handle_syncline (char *args, location loc)
lineno = INT_MAX; lineno = INT_MAX;
} }
current_file = uniqstr_new (file); current_file = uniqstr_new (file);
boundary_set, (&scanner_cursor, current_file, lineno, 1); boundary_set (&scanner_cursor, current_file, lineno, 1);
} }