"GOT", but the "O" is a cute, smiling pufferfish. Index | Thread | Search

From:
Tracey Emery <tracey@traceyemery.net>
Subject:
Silence warnings being treated as errors on sparc64 and yacc rules reduced error
To:
gameoftrees@openbsd.org
Date:
Wed, 8 Feb 2023 16:44:05 -0700

Download raw body.

Thread
Hello,

This silences two warnings treated as errors on sparc64 (warning:
function declaration isn't a prototype). We also don't use boolen in
gotd's parse.y, so this removes our reduction error. We can either let
that languish, if we plan to use it in the future, or replace boolean
later.

ok?

-- 

Tracey Emery

diff /home/tracey/src/got
commit - 2ec74a9e9c334f3245765a6e6f35b7977f5b420e
path + /home/tracey/src/got
blob - e1f90c1960d3e783711dd5f2f29e41b254d35a57
file + gotd/gotd.c
--- gotd/gotd.c
+++ gotd/gotd.c
@@ -105,7 +105,7 @@ usage()
 static void kill_proc(struct gotd_child_proc *, int);
 
 __dead static void
-usage()
+usage(void)
 {
 	fprintf(stderr, "usage: %s [-dnv] [-f config-file]\n", getprogname());
 	exit(1);
blob - 51cf2780d3077e2b6c6f8202d840cfe73f46b425
file + gotd/parse.y
--- gotd/parse.y
+++ gotd/parse.y
@@ -109,7 +109,6 @@ typedef struct {
 
 %token	<v.string>	STRING
 %token	<v.number>	NUMBER
-%type	<v.number>	boolean
 %type	<v.tv>		timeout
 
 %%
@@ -120,26 +119,6 @@ boolean		: STRING {
 		| grammar repository '\n'
 		;
 
-boolean		: STRING {
-			if (strcasecmp($1, "1") == 0 ||
-			    strcasecmp($1, "yes") == 0 ||
-			    strcasecmp($1, "on") == 0)
-				$$ = 1;
-			else if (strcasecmp($1, "0") == 0 ||
-			    strcasecmp($1, "off") == 0 ||
-			    strcasecmp($1, "no") == 0)
-				$$ = 0;
-			else {
-				yyerror("invalid boolean value '%s'", $1);
-				free($1);
-				YYERROR;
-			}
-			free($1);
-		}
-		| ON { $$ = 1; }
-		| NUMBER { $$ = $1; }
-		;
-
 timeout		: NUMBER {
 			if ($1 < 0) {
 				yyerror("invalid timeout: %lld", $1);
blob - 43dacf20c7b2d23ff032cdb48ebbd511772503bf
file + gotsh/gotsh.c
--- gotsh/gotsh.c
+++ gotsh/gotsh.c
@@ -36,7 +36,7 @@ usage()
 static int chattygot;
 
 __dead static void
-usage()
+usage(void)
 {
 	fprintf(stderr, "usage: %s -c '%s|%s repository-path'\n",
 	    getprogname(), GOT_SERVE_CMD_SEND, GOT_SERVE_CMD_FETCH);