summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMariusz PluciƄski <mplucinski@mplucinski.com>2014-07-25 16:58:17 +0200
committerWill Estes <westes575@gmail.com>2014-11-23 20:29:49 -0500
commit71e207c1ac1bb664326a5539d93a022bf0deade9 (patch)
tree015a573a5b204a00b5a7ef177d1b92e4cd8ba515
parentc0303615a661ee0fcb399b888efb2a653e6b66ed (diff)
Fix a few "unused parameter" warnings
-rw-r--r--src/flex.skl16
-rw-r--r--src/libmain.c6
-rw-r--r--src/parse.y1
-rw-r--r--tests/bison_nr_main.c3
-rw-r--r--tests/bison_yylloc_main.c4
-rw-r--r--tests/bison_yylloc_parser.y1
-rw-r--r--tests/bison_yylval_main.c4
-rw-r--r--tests/bison_yylval_parser.y1
-rw-r--r--tests/header_nr_main.c3
-rw-r--r--tests/header_r_main.c3
-rw-r--r--tests/lineno_nr.l2
-rw-r--r--tests/lineno_r.l2
-rw-r--r--tests/lineno_trailing.l2
-rw-r--r--tests/mem_r.l6
-rw-r--r--tests/multiple_scanners_nr_main.c3
-rw-r--r--tests/multiple_scanners_r_main.c3
-rw-r--r--tests/pthread.l8
-rw-r--r--tests/rescan_nr.direct.l2
-rw-r--r--tests/rescan_r.direct.l2
-rw-r--r--tests/top_main.c3
20 files changed, 71 insertions, 4 deletions
diff --git a/src/flex.skl b/src/flex.skl
index 10b27e2..4d75395 100644
--- a/src/flex.skl
+++ b/src/flex.skl
@@ -2498,7 +2498,8 @@ m4_ifdef( [[M4_YY_NO_TOP_STATE]],,
%if-c-only
static void yy_fatal_error YYFARGS1(yyconst char*, msg)
{
- m4_dnl M4_YY_DECL_GUTS_VAR();
+ M4_YY_DECL_GUTS_VAR();
+ M4_YY_NOOP_GUTS_VAR();
(void) fprintf( stderr, "%s\n", msg );
exit( YY_EXIT_FAILURE );
}
@@ -2981,6 +2982,9 @@ m4_ifdef( [[M4_YY_NOT_IN_HEADER]],
#ifndef yytext_ptr
static void yy_flex_strncpy YYFARGS3( char*,s1, yyconst char *,s2, int,n)
{
+ M4_YY_DECL_GUTS_VAR();
+ M4_YY_NOOP_GUTS_VAR();
+
int i;
for ( i = 0; i < n; ++i )
s1[i] = s2[i];
@@ -3006,6 +3010,8 @@ m4_ifdef( [[M4_YY_NO_FLEX_ALLOC]],,
[[
void *yyalloc YYFARGS1( yy_size_t ,size)
{
+ M4_YY_DECL_GUTS_VAR();
+ M4_YY_NOOP_GUTS_VAR();
return (void *) malloc( size );
}
]])
@@ -3014,6 +3020,9 @@ m4_ifdef( [[M4_YY_NO_FLEX_REALLOC]],,
[[
void *yyrealloc YYFARGS2( void *,ptr, yy_size_t ,size)
{
+ M4_YY_DECL_GUTS_VAR();
+ M4_YY_NOOP_GUTS_VAR();
+
/* The cast to (char *) in the following accommodates both
* implementations that use char* generic pointers, and those
* that use void* generic pointers. It works with the latter
@@ -3029,6 +3038,8 @@ m4_ifdef( [[M4_YY_NO_FLEX_FREE]],,
[[
void yyfree YYFARGS1( void *,ptr)
{
+ M4_YY_DECL_GUTS_VAR();
+ M4_YY_NOOP_GUTS_VAR();
free( (char *) ptr ); /* see yyrealloc() for (char *) cast */
}
]])
@@ -3123,6 +3134,9 @@ static int yytbl_hdr_read YYFARGS2(struct yytbl_hdr *, th, struct yytbl_reader *
static struct yytbl_dmap *yytbl_dmap_lookup YYFARGS2(struct yytbl_dmap *, dmap,
int, id)
{
+ M4_YY_DECL_GUTS_VAR();
+ M4_YY_NOOP_GUTS_VAR();
+
while (dmap->dm_id)
if (dmap->dm_id == id)
return dmap;
diff --git a/src/libmain.c b/src/libmain.c
index d4d5b6d..f400fc3 100644
--- a/src/libmain.c
+++ b/src/libmain.c
@@ -25,8 +25,10 @@ extern int yylex (void);
int main (int argc, char *argv[])
{
- while (yylex () != 0)
- continue;
+ (void)argc;
+ (void)argv;
+
+ while (yylex () != 0) ;
return 0;
}
diff --git a/src/parse.y b/src/parse.y
index d0cc706..939cc05 100644
--- a/src/parse.y
+++ b/src/parse.y
@@ -1086,4 +1086,5 @@ int line;
void yyerror( msg )
const char *msg;
{
+ (void)msg;
}
diff --git a/tests/bison_nr_main.c b/tests/bison_nr_main.c
index 2585750..f5dd98a 100644
--- a/tests/bison_nr_main.c
+++ b/tests/bison_nr_main.c
@@ -28,6 +28,9 @@ extern int testparse(void);
int main ( int argc, char** argv )
{
+ (void)argc;
+ (void)argv;
+
/*yydebug =1;*/
testin = stdin;
testparse ( );
diff --git a/tests/bison_yylloc_main.c b/tests/bison_yylloc_main.c
index f9fb63d..0274d39 100644
--- a/tests/bison_yylloc_main.c
+++ b/tests/bison_yylloc_main.c
@@ -27,6 +27,10 @@
int main ( int argc, char** argv )
{
yyscan_t scanner;
+
+ (void)argc;
+ (void)argv;
+
/*yydebug =1;*/
testlex_init ( &scanner );
testset_in(stdin,scanner);
diff --git a/tests/bison_yylloc_parser.y b/tests/bison_yylloc_parser.y
index d2dfc13..e807c4d 100644
--- a/tests/bison_yylloc_parser.y
+++ b/tests/bison_yylloc_parser.y
@@ -90,6 +90,7 @@ line:
%%
int yyerror(void* scanner, char* msg) {
+ (void)scanner;
fprintf(stderr,"%s\n",msg);
return 0;
}
diff --git a/tests/bison_yylval_main.c b/tests/bison_yylval_main.c
index f615c4b..fb04538 100644
--- a/tests/bison_yylval_main.c
+++ b/tests/bison_yylval_main.c
@@ -27,6 +27,10 @@
int main ( int argc, char** argv )
{
yyscan_t scanner;
+
+ (void)argc;
+ (void)argv;
+
/*yydebug =1;*/
testlex_init ( &scanner );
testset_in(stdin,scanner);
diff --git a/tests/bison_yylval_parser.y b/tests/bison_yylval_parser.y
index 626c5e7..a6ebfd3 100644
--- a/tests/bison_yylval_parser.y
+++ b/tests/bison_yylval_parser.y
@@ -75,6 +75,7 @@ endtag: LTSLASH TAGNAME GT { process_text($2);free($2);} ;
%%
int yyerror(void* scanner, char* msg) {
+ (void)scanner;
fprintf(stderr,"%s\n",msg);
return 0;
}
diff --git a/tests/header_nr_main.c b/tests/header_nr_main.c
index 0ac60d9..bb14749 100644
--- a/tests/header_nr_main.c
+++ b/tests/header_nr_main.c
@@ -26,6 +26,9 @@
int
main ( int argc, char** argv )
{
+ (void)argc;
+ (void)argv;
+
testin = stdin;
testout = stdout;
testlex();
diff --git a/tests/header_r_main.c b/tests/header_r_main.c
index 6c3dd8f..661457a 100644
--- a/tests/header_r_main.c
+++ b/tests/header_r_main.c
@@ -30,6 +30,9 @@
int
main ( int argc, char** argv )
{
+ (void)argc;
+ (void)argv;
+
yyscan_t scanner;
FILE *fp;
char * extra = "EXTRA";
diff --git a/tests/lineno_nr.l b/tests/lineno_nr.l
index 501ae1e..3072de4 100644
--- a/tests/lineno_nr.l
+++ b/tests/lineno_nr.l
@@ -82,6 +82,8 @@ main ( argc, argv )
int argc;
char** argv;
{
+ (void)argv;
+
if( argc > 1 )
printf("%d\n", count_newlines(stdin));
diff --git a/tests/lineno_r.l b/tests/lineno_r.l
index 4132ed3..4433575 100644
--- a/tests/lineno_r.l
+++ b/tests/lineno_r.l
@@ -82,6 +82,8 @@ main (argc, argv)
int argc;
char ** argv;
{
+ (void)argv;
+
if( argc > 1 )
printf("%d\n", count_newlines(stdin));
diff --git a/tests/lineno_trailing.l b/tests/lineno_trailing.l
index 9e83dab..9ac2c84 100644
--- a/tests/lineno_trailing.l
+++ b/tests/lineno_trailing.l
@@ -75,6 +75,8 @@ main ( argc, argv )
int argc;
char** argv;
{
+ (void)argv;
+
if( argc > 1 )
printf("%d\n", count_newlines(stdin));
diff --git a/tests/mem_r.l b/tests/mem_r.l
index 861a7b7..ec150c0 100644
--- a/tests/mem_r.l
+++ b/tests/mem_r.l
@@ -87,6 +87,8 @@ static void dump_mem(FILE* fp){
void * yyalloc(yy_size_t n , void* yyscanner)
{
+ (void)yyscanner;
+
void * p;
int i;
@@ -116,6 +118,8 @@ void * yyalloc(yy_size_t n , void* yyscanner)
void * yyrealloc(void* p, yy_size_t n , void* yyscanner)
{
+ (void)yyscanner;
+
int i;
for (i=0; i < arrsz; i++)
if ( ptrs[i].p == p){
@@ -137,6 +141,8 @@ void * yyrealloc(void* p, yy_size_t n , void* yyscanner)
void yyfree(void* p , void* yyscanner)
{
+ (void)yyscanner;
+
int i;
for (i=0; i < arrsz; i++)
if ( ptrs[i].p == p){
diff --git a/tests/multiple_scanners_nr_main.c b/tests/multiple_scanners_nr_main.c
index 3763dbc..ff1a6d5 100644
--- a/tests/multiple_scanners_nr_main.c
+++ b/tests/multiple_scanners_nr_main.c
@@ -27,6 +27,9 @@
int
main ( int argc, char** argv )
{
+ (void)argc;
+ (void)argv;
+
int S1_ok=1, S2_ok=1;
YY_BUFFER_STATE buff1, buff2;
S1_out = S2_out = stdout;
diff --git a/tests/multiple_scanners_r_main.c b/tests/multiple_scanners_r_main.c
index 1b3ea0a..ea73806 100644
--- a/tests/multiple_scanners_r_main.c
+++ b/tests/multiple_scanners_r_main.c
@@ -27,6 +27,9 @@
int
main ( int argc, char** argv )
{
+ (void)argc;
+ (void)argv;
+
int S1_ok=1, S2_ok=1;
FILE * fp;
YY_BUFFER_STATE buff1, buff2;
diff --git a/tests/pthread.l b/tests/pthread.l
index 1084321..985d214 100644
--- a/tests/pthread.l
+++ b/tests/pthread.l
@@ -78,9 +78,13 @@ static int process_text(char* s, yyscan_t scanner);
<INITIAL,STATE_1,STATE_2>[[:space:]\r\n]+ { }
%%
-int yywrap( yyscan_t scanner) { return 1; }
+int yywrap( yyscan_t scanner) {
+ (void)scanner;
+ return 1;
+}
static int process_text(char* s, yyscan_t scanner)
{
+ (void)scanner;
return (int)(*s) + (int) *(s + yyget_leng(scanner)-1);
}
@@ -114,6 +118,8 @@ void * thread_func ( void* arg )
{
int i;
+ (void)arg;
+
/* Wait for go-ahead. */
pthread_mutex_lock( &go_ahead);
pthread_mutex_unlock(&go_ahead);
diff --git a/tests/rescan_nr.direct.l b/tests/rescan_nr.direct.l
index 18f29bb..84de3a4 100644
--- a/tests/rescan_nr.direct.l
+++ b/tests/rescan_nr.direct.l
@@ -51,6 +51,8 @@ main (int argc, char* const argv[])
FILE* fp;
int i;
+ (void)argc;
+
if ((fp = fopen(argv[1],"r")) == NULL){
perror("Failed to open input file.");
return 1;
diff --git a/tests/rescan_r.direct.l b/tests/rescan_r.direct.l
index a6073dd..7cc8857 100644
--- a/tests/rescan_r.direct.l
+++ b/tests/rescan_r.direct.l
@@ -52,6 +52,8 @@ main (int argc, char* const argv[])
int i;
yyscan_t yyscanner;
+ (void)argc;
+
if ((fp = fopen(argv[1],"r")) == NULL){
perror("Failed to open input file.");
return 1;
diff --git a/tests/top_main.c b/tests/top_main.c
index 3ac436d..d383ce5 100644
--- a/tests/top_main.c
+++ b/tests/top_main.c
@@ -30,6 +30,9 @@
int
main ( int argc, char** argv )
{
+ (void)argc;
+ (void)argv;
+
yyscan_t scanner;
FILE *fp;
char * extra = "EXTRA";