From 7e30afce04b513f04457e7b94d25cad8950948ee Mon Sep 17 00:00:00 2001 From: millert Date: Tue, 18 Jun 2024 02:11:03 +0000 Subject: [PATCH] Quiet compiler warnings when built with WARNINGS=Yes Most are from functions that take no args but used the old K&R style foo() instead of foo(void). From espie@ --- usr.bin/make/buf.c | 4 ++-- usr.bin/make/compat.c | 6 +++--- usr.bin/make/error.c | 4 ++-- usr.bin/make/job.c | 12 ++++++------ usr.bin/make/main.c | 16 ++++++++-------- usr.bin/make/make.c | 8 ++++---- usr.bin/make/parse.c | 12 ++++++------ usr.bin/make/parsevar.c | 15 +-------------- usr.bin/make/targ.c | 4 ++-- usr.bin/make/targequiv.c | 4 ++-- usr.bin/make/var.c | 6 +++--- usr.bin/make/varmodifiers.c | 4 ++-- 12 files changed, 41 insertions(+), 54 deletions(-) diff --git a/usr.bin/make/buf.c b/usr.bin/make/buf.c index 92f27d1d614..2453d642535 100644 --- a/usr.bin/make/buf.c +++ b/usr.bin/make/buf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: buf.c,v 1.30 2023/09/04 11:35:11 espie Exp $ */ +/* $OpenBSD: buf.c,v 1.31 2024/06/18 02:11:03 millert Exp $ */ /* $NetBSD: buf.c,v 1.9 1996/12/31 17:53:21 christos Exp $ */ /* @@ -90,7 +90,7 @@ #endif static void -fatal_overflow() +fatal_overflow(void) { fprintf(stderr, "buffer size overflow\n"); exit(2); diff --git a/usr.bin/make/compat.c b/usr.bin/make/compat.c index 57a9eb4e591..f3ba4a89f94 100644 --- a/usr.bin/make/compat.c +++ b/usr.bin/make/compat.c @@ -1,4 +1,4 @@ -/* $OpenBSD: compat.c,v 1.94 2023/09/04 11:35:11 espie Exp $ */ +/* $OpenBSD: compat.c,v 1.95 2024/06/18 02:11:03 millert Exp $ */ /* $NetBSD: compat.c,v 1.14 1996/11/06 17:59:01 christos Exp $ */ /* @@ -247,12 +247,12 @@ CompatMake(void *gnp, /* The node to make */ } void -Compat_Init() +Compat_Init(void) { } void -Compat_Update(GNode *gn) +Compat_Update(GNode *gn UNUSED) { } diff --git a/usr.bin/make/error.c b/usr.bin/make/error.c index fd6afa06b40..b6469635ccd 100644 --- a/usr.bin/make/error.c +++ b/usr.bin/make/error.c @@ -1,4 +1,4 @@ -/* $OpenBSD: error.c,v 1.26 2023/09/04 11:35:11 espie Exp $ */ +/* $OpenBSD: error.c,v 1.27 2024/06/18 02:11:03 millert Exp $ */ /* * Copyright (c) 2001 Marc Espie. @@ -122,7 +122,7 @@ Punt(const char *fmt, ...) * The program exits */ void -Finish() +Finish(void) { Job_Wait(); print_errors(); diff --git a/usr.bin/make/job.c b/usr.bin/make/job.c index 09fce16d0bb..36ed9ab8f90 100644 --- a/usr.bin/make/job.c +++ b/usr.bin/make/job.c @@ -1,4 +1,4 @@ -/* $OpenBSD: job.c,v 1.165 2023/09/04 11:35:11 espie Exp $ */ +/* $OpenBSD: job.c,v 1.166 2024/06/18 02:11:03 millert Exp $ */ /* $NetBSD: job.c,v 1.16 1996/11/06 17:59:08 christos Exp $ */ /* @@ -297,7 +297,7 @@ quick_summary(int signo) } static void -internal_print_errors() +internal_print_errors(void) { Job *j, *k, *jnext; int dying; @@ -375,7 +375,7 @@ notice_signal(int sig) } void -Sigset_Init() +Sigset_Init(void) { sigemptyset(&emptyset); sigprocmask(SIG_BLOCK, &emptyset, &origset); @@ -664,7 +664,7 @@ may_continue_job(Job *job) } static void -may_continue_heldback_jobs() +may_continue_heldback_jobs(void) { while (!no_new_jobs) { if (heldJobs != NULL) { @@ -775,7 +775,7 @@ reap_jobs(void) } void -reset_signal_mask() +reset_signal_mask(void) { sigprocmask(SIG_SETMASK, &origset, NULL); } @@ -811,7 +811,7 @@ handle_running_jobs(void) } void -loop_handle_running_jobs() +loop_handle_running_jobs(void) { while (runningJobs != NULL) handle_running_jobs(); diff --git a/usr.bin/make/main.c b/usr.bin/make/main.c index 5f602e4e0d7..7824346d0ef 100644 --- a/usr.bin/make/main.c +++ b/usr.bin/make/main.c @@ -1,4 +1,4 @@ -/* $OpenBSD: main.c,v 1.132 2023/09/04 11:35:11 espie Exp $ */ +/* $OpenBSD: main.c,v 1.133 2024/06/18 02:11:03 millert Exp $ */ /* $NetBSD: main.c,v 1.34 1997/03/24 20:56:36 gwr Exp $ */ /* @@ -127,7 +127,7 @@ record_option(int c, const char *arg) } void -set_notparallel() +set_notparallel(void) { compatMake = true; } @@ -465,7 +465,7 @@ add_dirpath(Lst l, const char *n) * run-time. */ static char * -figure_out_MACHINE() +figure_out_MACHINE(void) { char *r = getenv("MACHINE"); if (r == NULL) { @@ -479,7 +479,7 @@ figure_out_MACHINE() } static char * -figure_out_MACHINE_ARCH() +figure_out_MACHINE_ARCH(void) { char *r = getenv("MACHINE_ARCH"); if (r == NULL) { @@ -492,7 +492,7 @@ figure_out_MACHINE_ARCH() return r; } static char * -figure_out_MACHINE_CPU() +figure_out_MACHINE_CPU(void) { char *r = getenv("MACHINE_CPU"); if (r == NULL) { @@ -510,7 +510,7 @@ figure_out_MACHINE_CPU() } static char * -figure_out_CURDIR() +figure_out_CURDIR(void) { char *dir, *cwd; struct stat sa, sb; @@ -577,7 +577,7 @@ setup_CURDIR_OBJDIR(struct dirs *d) * ::... */ static void -setup_VPATH() +setup_VPATH(void) { if (Var_Value("VPATH") != NULL) { char *vpath; @@ -936,7 +936,7 @@ found: Var_Set("MAKEFILE", fname); * exit with usage message */ static void -usage() +usage(void) { (void)fprintf(stderr, "usage: make [-BeiknpqrSst] [-C directory] [-D variable] [-d flags] [-f mk]\n\ diff --git a/usr.bin/make/make.c b/usr.bin/make/make.c index f3700c7d6ff..d492c7f2598 100644 --- a/usr.bin/make/make.c +++ b/usr.bin/make/make.c @@ -1,4 +1,4 @@ -/* $OpenBSD: make.c,v 1.84 2023/09/04 11:35:11 espie Exp $ */ +/* $OpenBSD: make.c,v 1.85 2024/06/18 02:11:03 millert Exp $ */ /* $NetBSD: make.c,v 1.10 1996/11/06 17:59:15 christos Exp $ */ /* @@ -118,13 +118,13 @@ static bool randomize_queue; long random_delay = 0; bool -nothing_left_to_build() +nothing_left_to_build(void) { return Array_IsEmpty(&to_build); } static void -random_setup() +random_setup(void) { randomize_queue = Var_Definedi("RANDOM_ORDER", NULL); @@ -503,7 +503,7 @@ add_targets_to_make(Lst todo) } void -Make_Init() +Make_Init(void) { /* wild guess at initial sizes */ Array_Init(&to_build, 500); diff --git a/usr.bin/make/parse.c b/usr.bin/make/parse.c index ce1e2c0e7cc..3e2f3f1cbc0 100644 --- a/usr.bin/make/parse.c +++ b/usr.bin/make/parse.c @@ -1,4 +1,4 @@ -/* $OpenBSD: parse.c,v 1.136 2023/09/04 11:35:11 espie Exp $ */ +/* $OpenBSD: parse.c,v 1.137 2024/06/18 02:11:03 millert Exp $ */ /* $NetBSD: parse.c,v 1.29 1997/03/10 21:20:04 christos Exp $ */ /* @@ -219,7 +219,7 @@ static struct { #undef P static void -create_special_nodes() +create_special_nodes(void) { unsigned int i; @@ -690,7 +690,7 @@ parse_do_targets(Lst paths, unsigned int *op, const char *line) } static void -dump_targets() +dump_targets(void) { size_t i; for (i = 0; i < gtargets.n; i++) @@ -1436,6 +1436,7 @@ build_target_group(struct growableArray *targets, struct ohash *t) LstNode ln; bool seen_target = false; unsigned int i; + GNode *gn, *gn2; /* may be 0 if wildcard expansion resulted in zero match */ if (targets->n <= 1) @@ -1465,7 +1466,6 @@ build_target_group(struct growableArray *targets, struct ohash *t) if (seen_target) return; - GNode *gn, *gn2; /* targets may already participate in groupling lists, * so rebuild the circular list "from scratch" */ @@ -1488,7 +1488,7 @@ build_target_group(struct growableArray *targets, struct ohash *t) } static void -reset_target_hash() +reset_target_hash(void) { if (htargets_setup) ohash_delete(&htargets); @@ -1497,7 +1497,7 @@ reset_target_hash() } void -Parse_End() +Parse_End(void) { if (htargets_setup) ohash_delete(&htargets); diff --git a/usr.bin/make/parsevar.c b/usr.bin/make/parsevar.c index c90ed89e045..855e049df84 100644 --- a/usr.bin/make/parsevar.c +++ b/usr.bin/make/parsevar.c @@ -1,4 +1,4 @@ -/* $OpenBSD: parsevar.c,v 1.17 2023/09/04 11:35:11 espie Exp $ */ +/* $OpenBSD: parsevar.c,v 1.18 2024/06/18 02:11:03 millert Exp $ */ /* $NetBSD: parse.c,v 1.29 1997/03/10 21:20:04 christos Exp $ */ /* @@ -38,7 +38,6 @@ #include "parsevar.h" static const char *find_op1(const char *); -static const char *find_op2(const char *); static bool parse_variable_assignment(const char *, int); static const char * @@ -55,18 +54,6 @@ find_op1(const char *p) return p; } -static const char * -find_op2(const char *p) -{ - for(;; p++) { - if (ISSPACE(*p) || *p == '$' || *p == '\0') - break; - if (p[strspn(p, "?:!+")] == '=') - break; - } - return p; -} - static bool parse_variable_assignment(const char *line, int ctxt) { diff --git a/usr.bin/make/targ.c b/usr.bin/make/targ.c index 2a6fc595dd3..a3b94fa3366 100644 --- a/usr.bin/make/targ.c +++ b/usr.bin/make/targ.c @@ -1,4 +1,4 @@ -/* $OpenBSD: targ.c,v 1.87 2024/05/21 05:00:48 jsg Exp $ */ +/* $OpenBSD: targ.c,v 1.88 2024/06/18 02:11:03 millert Exp $ */ /* $NetBSD: targ.c,v 1.11 1997/02/20 16:51:50 christos Exp $ */ /* @@ -337,7 +337,7 @@ status_to_string(GNode *gn) } struct ohash * -targets_hash() +targets_hash(void) { return &targets; } diff --git a/usr.bin/make/targequiv.c b/usr.bin/make/targequiv.c index 8325e9e159d..48ba4bcc415 100644 --- a/usr.bin/make/targequiv.c +++ b/usr.bin/make/targequiv.c @@ -1,4 +1,4 @@ -/* $OpenBSD: targequiv.c,v 1.10 2023/09/04 11:35:11 espie Exp $ */ +/* $OpenBSD: targequiv.c,v 1.11 2024/06/18 02:11:04 millert Exp $ */ /* * Copyright (c) 2007-2008 Marc Espie. * @@ -109,7 +109,7 @@ add_to_equiv_list(struct ohash *equiv, GNode *gn) } static void -build_equivalence() +build_equivalence(void) { unsigned int i; GNode *gn; diff --git a/usr.bin/make/var.c b/usr.bin/make/var.c index 65f938180f3..1ac643d7265 100644 --- a/usr.bin/make/var.c +++ b/usr.bin/make/var.c @@ -1,4 +1,4 @@ -/* $OpenBSD: var.c,v 1.106 2023/09/04 11:35:11 espie Exp $ */ +/* $OpenBSD: var.c,v 1.107 2024/06/18 02:11:04 millert Exp $ */ /* $NetBSD: var.c,v 1.18 1997/03/18 19:24:46 christos Exp $ */ /* @@ -1365,7 +1365,7 @@ Var_SubstVar(Buffer buf, /* To store result */ ***/ static void -set_magic_shell_variable() +set_magic_shell_variable(void) { const char *name = "SHELL"; const char *ename = NULL; @@ -1380,7 +1380,7 @@ set_magic_shell_variable() } static void -set_magic_name_list_variable() +set_magic_name_list_variable(void) { const char *name = VARNAME_LIST; const char *ename = NULL; diff --git a/usr.bin/make/varmodifiers.c b/usr.bin/make/varmodifiers.c index 8ad0255394d..2c2e352a4b3 100644 --- a/usr.bin/make/varmodifiers.c +++ b/usr.bin/make/varmodifiers.c @@ -1,4 +1,4 @@ -/* $OpenBSD: varmodifiers.c,v 1.49 2023/09/04 11:35:11 espie Exp $ */ +/* $OpenBSD: varmodifiers.c,v 1.50 2024/06/18 02:11:04 millert Exp $ */ /* $NetBSD: var.c,v 1.18 1997/03/18 19:24:46 christos Exp $ */ /* @@ -174,7 +174,7 @@ static struct modifier { ; void -VarModifiers_Init() +VarModifiers_Init(void) { choose_mod['M'] = &match_mod; choose_mod['N'] = &nomatch_mod; -- 2.20.1