summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDi-an Jan <dianj@freeshell.org>2008-11-17 11:01:41 +0100
committerPaolo Bonzini <bonzini@gnu.org>2008-11-17 11:01:41 +0100
commitd73e55e02203fc062baa498543571bba452e59ce (patch)
tree4ad16629fdd7f3bf00fbca10195d71d9205ac89a
parent68c989dea90f8546b6f0e3a25e68de6e389baf78 (diff)
downloadbison-d73e55e02203fc062baa498543571bba452e59ce.tar.gz
Handles several --enable-gcc-warnings.
* src/getargs.c (command_line_location): Set parameters to void. * src/output.c (symbol_type_name_cmp): Make static. (symbols_by_type_name): Set parameters to void. (symbol_definitions_output): Remove unused parameter. Rename as... (prepare_symbol_definitions): this. (muscles_output): Move symbol_definitions_output to... (output): here as prepare_symbol_definitions. * tests/c++.at (AT_CHECK_VARIANTS): Remove unused parameters of main. (AT_CHECK_NAMESPACE): Make unused parameter lloc unnamed.
-rw-r--r--ChangeLog13
-rw-r--r--src/getargs.c2
-rw-r--r--src/output.c14
-rw-r--r--tests/c++.at4
4 files changed, 23 insertions, 10 deletions
diff --git a/ChangeLog b/ChangeLog
index bfa5eee3..db9bf08c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,18 @@
2008-11-17 Di-an Jan <dianj@freeshell.org>
+ Handles several --enable-gcc-warnings.
+ * src/getargs.c (command_line_location): Set parameters to void.
+ * src/output.c (symbol_type_name_cmp): Make static.
+ (symbols_by_type_name): Set parameters to void.
+ (symbol_definitions_output): Remove unused parameter. Rename as...
+ (prepare_symbol_definitions): this.
+ (muscles_output): Move symbol_definitions_output to...
+ (output): here as prepare_symbol_definitions.
+ * tests/c++.at (AT_CHECK_VARIANTS): Remove unused parameters of main.
+ (AT_CHECK_NAMESPACE): Make unused parameter lloc unnamed.
+
+2008-11-17 Di-an Jan <dianj@freeshell.org>
+
* tests/c++.at (AT_CHECK_VARIANTS): Fixes tests 198-202.
Use AT_DATA_GRAMMAR instead of AT_DATA for compiled tests.
diff --git a/src/getargs.c b/src/getargs.c
index 53934f33..6b748c8b 100644
--- a/src/getargs.c
+++ b/src/getargs.c
@@ -499,7 +499,7 @@ static struct option const long_options[] =
/* Build a location for the current command line argument. */
static
location
-command_line_location()
+command_line_location (void)
{
location res;
/* "<command line>" is used in GCC's messages about -D. */
diff --git a/src/output.c b/src/output.c
index 31bfd12d..73e63485 100644
--- a/src/output.c
+++ b/src/output.c
@@ -287,7 +287,7 @@ prepare_states (void)
| Compare two symbols by type-name, and then by number. |
`-------------------------------------------------------*/
-int
+static int
symbol_type_name_cmp (const symbol **lhs, const symbol **rhs)
{
int res = UNIQSTR_CMP((*lhs)->type_name, (*rhs)->type_name);
@@ -302,7 +302,7 @@ symbol_type_name_cmp (const symbol **lhs, const symbol **rhs)
`----------------------------------------------------------------*/
static symbol **
-symbols_by_type_name ()
+symbols_by_type_name (void)
{
typedef int (*qcmp_type) (const void *, const void *);
symbol **res = xmemdup (symbols, nsyms * sizeof *res);
@@ -396,12 +396,12 @@ merger_output (FILE *out)
}
-/*---------------------------------------.
-| Output the symbol definitions to OUT. |
-`---------------------------------------*/
+/*---------------------------------------------.
+| Prepare the muscles for symbol definitions. |
+`---------------------------------------------*/
static void
-symbol_definitions_output (FILE *out)
+prepare_symbol_definitions (void)
{
int i;
for (i = 0; i < nsyms; ++i)
@@ -596,7 +596,6 @@ muscles_output (FILE *out)
merger_output (out);
symbol_code_props_output (out, "destructors", &symbol_destructor_get);
symbol_code_props_output (out, "printers", &symbol_printer_get);
- symbol_definitions_output (out);
symbol_numbers_output (out);
token_definitions_output (out);
type_names_output (out);
@@ -794,6 +793,7 @@ output (void)
prepare_rules ();
prepare_states ();
prepare_actions ();
+ prepare_symbol_definitions ();
prepare ();
diff --git a/tests/c++.at b/tests/c++.at
index f1b1b3ac..e2f9d03f 100644
--- a/tests/c++.at
+++ b/tests/c++.at
@@ -174,7 +174,7 @@ yy::parser::error(const yy::parser::location_type&,
}
int
-main(int argc, char *argv[])
+main (void)
{
yy::parser p;
p.set_debug_level(!!getenv("YYDEBUG"));
@@ -310,7 +310,7 @@ AT_DATA_GRAMMAR([[input.y]],
%code {
// YYSTYPE contains a namespace reference.
- int yylex (YYSTYPE *lval, const ]$1[::parser::location_type* lloc) {
+ int yylex (YYSTYPE *lval, const ]$1[::parser::location_type*) {
lval->i = 3;
return 0;
}