From: Paul Eggert Date: Sun, 22 Jan 2006 08:17:18 +0000 (+0000) Subject: * src/assoc.c (assoc_to_string): Use a default: abort (); case X-Git-Tag: v2.3b~479 X-Git-Url: https://git.saurik.com/bison.git/commitdiff_plain/06f01bc4964795ec030c756e292f52b6f439a3d4?ds=inline * src/assoc.c (assoc_to_string): Use a default: abort (); case to pacify gcc -Wswitch-default. * src/scan-gram.l (adjust_location): Use a default: break; case to pacify gcc -Wswitch-default. * src/scan-skel.h (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): Move these decls to scan-skel.l, since they don't need to be visible elsewhere. * src/scan-skel.l: Accept the above decls. (skel_lex): New decl, to pacify GCC when unpatched flex 2.5.31 is used. --- diff --git a/ChangeLog b/ChangeLog index 88417857..dec37cec 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,18 @@ +2006-01-22 Paul Eggert + + * src/assoc.c (assoc_to_string): Use a default: abort (); case + to pacify gcc -Wswitch-default. + * src/scan-gram.l (adjust_location): Use a default: break; case + to pacify gcc -Wswitch-default. + * src/scan-skel.h (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): + Move these decls to scan-skel.l, since they don't need to be + visible elsewhere. + * src/scan-skel.l: Accept the above decls. + (skel_lex): New decl, to pacify GCC when unpatched flex 2.5.31 + is used. + 2006-01-21 Paul Eggert * Makefile.cfg (local-checks-to-skip): Add changelog-check, diff --git a/src/assoc.c b/src/assoc.c index 479abd8c..6f9a3b56 100644 --- a/src/assoc.c +++ b/src/assoc.c @@ -1,5 +1,5 @@ /* Associativity information. - Copyright (C) 2002, 2005 Free Software Foundation, Inc. + Copyright (C) 2002, 2005, 2006 Free Software Foundation, Inc. This file is part of Bison, the GNU Compiler Compiler. @@ -29,6 +29,9 @@ assoc_to_string (assoc a) { switch (a) { + default: + abort (); + case undef_assoc: return "undefined associativity"; @@ -41,5 +44,4 @@ assoc_to_string (assoc a) case non_assoc: return "%nonassoc"; } - return NULL; } diff --git a/src/scan-gram.l b/src/scan-gram.l index 5cf5a28c..2ab163c6 100644 --- a/src/scan-gram.l +++ b/src/scan-gram.l @@ -752,12 +752,13 @@ adjust_location (location *loc, char const *token, size_t size) break; case '\t': - { - column = add_column_width (column, p0, p - p0); - column = add_column_width (column, NULL, 8 - ((column - 1) & 7)); - p0 = p + 1; - break; - } + column = add_column_width (column, p0, p - p0); + column = add_column_width (column, NULL, 8 - ((column - 1) & 7)); + p0 = p + 1; + break; + + default: + break; } scanner_cursor.line = line; diff --git a/src/scan-skel.h b/src/scan-skel.h index c5b19eac..a7e14c38 100644 --- a/src/scan-skel.h +++ b/src/scan-skel.h @@ -1,6 +1,6 @@ /* Scan Bison Skeletons. - Copyright (C) 2005 Free Software Foundation, Inc. + Copyright (C) 2005, 2006 Free Software Foundation, Inc. This file is part of Bison, the GNU Compiler Compiler. @@ -26,16 +26,3 @@ 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); diff --git a/src/scan-skel.l b/src/scan-skel.l index 8a57af51..c84eea13 100644 --- a/src/scan-skel.l +++ b/src/scan-skel.l @@ -39,6 +39,20 @@ #include "files.h" #include "scan-skel.h" +/* Pacify "gcc -Wmissing-prototypes" when flex 2.5.31 is used. */ +int skel_lex (void); +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); + #define QPUTS(String) \ fputs (quotearg_style (c_quoting_style, String), yyout)