diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2023-04-22 22:50:32 +0300 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2023-04-22 22:50:32 +0300 |
commit | 58503d8bf67a6563cb163b9988e707533d6d257e (patch) | |
tree | bc30d7bea0e445454841afcb5fe33b5cafd9e32a | |
parent | 93d8f65d4730cf93a66877c1cba71e3e7f888d9a (diff) | |
download | gawk-58503d8bf67a6563cb163b9988e707533d6d257e.tar.gz |
Fix a few -Wextra compilation warnings.
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | awkgram.c | 3 | ||||
-rw-r--r-- | awkgram.y | 3 | ||||
-rw-r--r-- | builtin.c | 2 | ||||
-rw-r--r-- | debug.c | 6 | ||||
-rw-r--r-- | eval.c | 1 | ||||
-rw-r--r-- | interpret.h | 3 | ||||
-rw-r--r-- | profile.c | 3 |
8 files changed, 16 insertions, 11 deletions
@@ -1,3 +1,9 @@ +2023-04-22 Arnold D. Robbins <arnold@skeeve.com> + + * awkgram.y, builtin.c, debug.c, eval.c, interpret.h, + profile.c: Fix some implicit fall through warnings. + Thanks to "Jannick" <thirdedition@gmx.net> for the report. + 2023-04-21 Arnold D. Robbins <arnold@skeeve.com> * array.c (asort_actual): Initialize `value' to avoid @@ -6369,10 +6369,11 @@ retry: case '{': if (++in_braces == 1) firstline = sourceline; + /* fall through */ case ';': case ',': case '[': - return lasttok = c; + return lasttok = c; case ']': c = nextc(true); pushback(); @@ -3867,10 +3867,11 @@ retry: case '{': if (++in_braces == 1) firstline = sourceline; + /* fall through */ case ';': case ',': case '[': - return lasttok = c; + return lasttok = c; case ']': c = nextc(true); pushback(); @@ -955,7 +955,7 @@ check_pos: zero_flag = true; if (lj) goto retry; - /* FALL through */ + /* fall through */ case '1': case '2': case '3': @@ -2517,8 +2517,7 @@ do_clear(CMDARG *arg, int cmd ATTRIBUTE_UNUSED) src = s->src; if (arg->type == D_func) goto func; - /* else - fall through */ + /* fall through */ case D_int: /* clear lineno */ lineno = (int) arg->a_int; if (lineno <= 0 || lineno > s->srclines) { @@ -3375,8 +3374,7 @@ do_until(CMDARG *arg, int cmd) src = s->src; if (arg->type == D_func) goto func; - /* else - fall through */ + /* fall through */ case D_int: /* until lineno */ lineno = arg->a_int; if (lineno <= 0 || lineno > s->srclines) { @@ -1155,6 +1155,7 @@ r_get_lhs(NODE *n, bool reference) case Node_var_array: fatal(_("attempt to use array `%s' in a scalar context"), array_vname(n)); + return NULL; // silence compiler warnings case Node_array_ref: if (n->orig_array->type == Node_var_array) fatal(_("attempt to use array `%s' in a scalar context"), diff --git a/interpret.h b/interpret.h index 70195d96..9ffa5bbd 100644 --- a/interpret.h +++ b/interpret.h @@ -275,8 +275,7 @@ uninitialized_scalar: PUSH(m); break; } - /* else - fall through */ + /* fall through */ case Op_push_array: PUSH(pc->memory); break; @@ -712,8 +712,7 @@ cleanup: case Op_push_re: if (pc->memory->type != Node_regex && (pc->memory->flags & REGEX) == 0) break; - /* else - fall through */ + /* fall through */ case Op_match_rec: { if (pc->memory->type == Node_regex) { |