summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2017-07-07 15:42:48 +0300
committerArnold D. Robbins <arnold@skeeve.com>2017-07-07 15:42:48 +0300
commit4cd70811e7e335fe568f62c564ac2bef0515694f (patch)
tree18c56e091b3ffd276d8c64b7cb9f4615ba86dfc0
parent6f10e610abfc6cdd68147ad817edd50440ed38ab (diff)
downloadgawk-4cd70811e7e335fe568f62c564ac2bef0515694f.tar.gz
Fix GCC 7.1 warnings (incrementing/decrementing booleans).
-rw-r--r--ChangeLog13
-rw-r--r--awk.h2
-rw-r--r--awkgram.c2
-rw-r--r--awkgram.y2
-rw-r--r--builtin.c4
-rw-r--r--cmd.h2
-rw-r--r--debug.c12
-rw-r--r--msg.c2
8 files changed, 26 insertions, 13 deletions
diff --git a/ChangeLog b/ChangeLog
index 17a6f566..4c34f193 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2017-07-07 Arnold D. Robbins <arnold@skeeve.com>
+
+ Remove warnings from GCC 7.1 compilation.
+
+ * awk.h (fatal_tag_valid): Change type to int.
+ * awkgram.y (yylex): Set did_newline to true instead of using ++.
+ * builtin.c (format_tree): Set lj to true instead of using ++.
+ * cmd.h (pager_quit_tag_valid): Change type to int.
+ * debug.c (pager_quit_tag_valid): Change type to int.
+ (do_clear): Make bp_found an int, change uses.
+ (do_run): Treat fatal_tag_valid as an int.
+ * msg.c (fatal_tag_valid): Change type to int.
+
2017-01-27 Andrew J. Schorr <aschorr@telemetry-investments.com>
* interpret.h [UNFIELD]: Fix condition for assignment from
diff --git a/awk.h b/awk.h
index ff622898..27fb2751 100644
--- a/awk.h
+++ b/awk.h
@@ -1282,7 +1282,7 @@ DEREF(NODE *r)
#define fatal (*(set_loc(__FILE__, __LINE__), r_fatal))
extern jmp_buf fatal_tag;
-extern bool fatal_tag_valid;
+extern int fatal_tag_valid;
#define PUSH_BINDING(stack, tag, val) \
if (val++) \
diff --git a/awkgram.c b/awkgram.c
index dbfc5e6e..7191c1e7 100644
--- a/awkgram.c
+++ b/awkgram.c
@@ -5737,7 +5737,7 @@ retry:
lastline = sourceline;
return lasttok = c;
}
- did_newline++;
+ did_newline = true;
--lexptr; /* pick up } next time */
return lasttok = NEWLINE;
diff --git a/awkgram.y b/awkgram.y
index 4eab3d6f..b0dd2830 100644
--- a/awkgram.y
+++ b/awkgram.y
@@ -3398,7 +3398,7 @@ retry:
lastline = sourceline;
return lasttok = c;
}
- did_newline++;
+ did_newline = true;
--lexptr; /* pick up } next time */
return lasttok = NEWLINE;
diff --git a/builtin.c b/builtin.c
index 18c01f6e..1eb2e3eb 100644
--- a/builtin.c
+++ b/builtin.c
@@ -943,7 +943,7 @@ check_pos:
*cur = get_number_si(arg);
if (*cur < 0 && cur == &fw) {
*cur = -*cur;
- lj++;
+ lj = true;
}
if (cur == &prec) {
if (*cur >= 0)
@@ -970,7 +970,7 @@ check_pos:
goto retry;
}
fill = sp; /* if left justified then other */
- lj++; /* filling is ignored */
+ lj = true; /* filling is ignored */
goto check_pos;
case '.':
if (cur != &fw)
diff --git a/cmd.h b/cmd.h
index 11844157..f663586c 100644
--- a/cmd.h
+++ b/cmd.h
@@ -36,7 +36,7 @@ extern NODE *get_function(void);
extern int gprintf(FILE *fp, const char *format, ...);
extern jmp_buf pager_quit_tag;
-extern bool pager_quit_tag_valid;
+extern int pager_quit_tag_valid;
extern bool output_is_tty;
extern int input_fd;
diff --git a/debug.c b/debug.c
index da8f2fa9..c7271785 100644
--- a/debug.c
+++ b/debug.c
@@ -270,7 +270,7 @@ static void save_options(const char *file);
/* pager */
jmp_buf pager_quit_tag;
-bool pager_quit_tag_valid = false;
+int pager_quit_tag_valid = 0;
static int screen_width = INT_MAX; /* no of columns */
static int screen_height = INT_MAX; /* no of rows */
static int pager_lines_printed = 0; /* no of lines printed so far */
@@ -2458,7 +2458,7 @@ do_clear(CMDARG *arg, int cmd ATTRIBUTE_UNUSED)
NODE *func;
SRCFILE *s = cur_srcfile;
char *src = cur_srcfile->src;
- bool bp_found = false;
+ int bp_found = 0;
if (arg == NULL) { /* clear */
CHECK_PROG_RUNNING();
@@ -2510,7 +2510,7 @@ func:
fprintf(out_fp, ", %d", b->number);
delete_breakpoint(b);
}
- if (! bp_found)
+ if (bp_found == 0)
fprintf(out_fp, _("No breakpoint(s) at entry to function `%s'\n"),
func->vname);
else
@@ -2537,7 +2537,7 @@ delete_bp:
}
}
- if (! bp_found)
+ if (bp_found == 0)
fprintf(out_fp, _("No breakpoint at file `%s', line #%d\n"),
src, (int) lineno);
else
@@ -2954,11 +2954,11 @@ do_run(CMDARG *arg ATTRIBUTE_UNUSED, int cmd ATTRIBUTE_UNUSED)
fprintf(out_fp, _("Starting program: \n"));
prog_running = true;
- fatal_tag_valid = true;
+ fatal_tag_valid = 1;
if (setjmp(fatal_tag) == 0)
(void) interpret(code_block);
- fatal_tag_valid = false;
+ fatal_tag_valid = 0;
prog_running = false;
fprintf(out_fp, (! exiting && exit_val != EXIT_SUCCESS)
? _("Program exited abnormally with exit value: %d\n")
diff --git a/msg.c b/msg.c
index 16fef73a..b89254e6 100644
--- a/msg.c
+++ b/msg.c
@@ -33,7 +33,7 @@ static const char *srcfile = NULL;
static int srcline;
jmp_buf fatal_tag;
-bool fatal_tag_valid = false;
+int fatal_tag_valid = 0;
/* err --- print an error message with source line and file and record */