aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog13
-rw-r--r--array.c2
-rw-r--r--extension/ChangeLog9
-rw-r--r--extension/inplace.c1
-rw-r--r--extension/revtwoway.c8
-rw-r--r--gawkapi.c3
-rw-r--r--mpfr.c2
-rw-r--r--node.c2
-rw-r--r--pc/ChangeLog4
-rw-r--r--pc/Makefile.tst15
-rw-r--r--test/ChangeLog5
-rwxr-xr-xtest/arrayind1.awk10
-rw-r--r--test/arrayind1.ok5
13 files changed, 58 insertions, 21 deletions
diff --git a/ChangeLog b/ChangeLog
index 1450e475..ac7aa53d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2016-07-01 Arnold D. Robbins <arnold@skeeve.com>
+
+ * array.c (value_info): Print something reasonable when stfmt
+ is -1.
+ * mpfr.c (mpg_format_val): Don't cast index to char.
+ * node.c (r_format_val): Ditto.
+ Thanks to Andrew Schorr for pointing these out.
+
+ Unrelated:
+
+ * gawkapi.c (api_warning): Fix the comment header.
+ (api_lintwarn): Factor out the call to va_end to after the if.
+
2016-06-26 Arnold D. Robbins <arnold@skeeve.com>
Repair change of 2015-08-25 to handling of MAYBE_NUM.
diff --git a/array.c b/array.c
index f8051065..edc192c0 100644
--- a/array.c
+++ b/array.c
@@ -704,7 +704,7 @@ value_info(NODE *n)
if ((n->flags & (STRING|STRCUR)) == STRCUR) {
fprintf(output_fp, "][");
fprintf(output_fp, "stfmt=%d, ", n->stfmt);
- fprintf(output_fp, "CONVFMT=\"%s\"", n->stfmt <= -1 ? "%ld"
+ fprintf(output_fp, "CONVFMT=\"%s\"", n->stfmt <= -1 ? "<unused>"
: fmt_list[n->stfmt]->stptr);
}
diff --git a/extension/ChangeLog b/extension/ChangeLog
index 06e8f6a5..b7668fc7 100644
--- a/extension/ChangeLog
+++ b/extension/ChangeLog
@@ -1,3 +1,12 @@
+2016-07-01 Arnold D. Robbins <arnold@skeeve.com>
+
+ * inplace.c (do_inplace_begin): Flush stdout at the start to
+ try to avoid flushing problems on some obscure BSD systems.
+ * revtwoway.c (gawk_getdtablesize): Renamed from getdtablesize.
+ (getdtablesize): New macro. Avoids problems on FreeBSD 10
+ where configure didn't work correctly. Thanks to Nelson Beebe.
+ Update copyright year.
+
2016-05-26 Andrew J. Schorr <aschorr@telemetry-investments.com>
* filefuncs.c (func_table): Update "stat" to indicate that the
diff --git a/extension/inplace.c b/extension/inplace.c
index 07d256b7..c7eb5564 100644
--- a/extension/inplace.c
+++ b/extension/inplace.c
@@ -125,6 +125,7 @@ do_inplace_begin(int nargs, awk_value_t *result)
int fd;
assert(result != NULL);
+ fflush(stdout);
if (state.tname)
fatal(ext_id, _("inplace_begin: in-place editing already active"));
diff --git a/extension/revtwoway.c b/extension/revtwoway.c
index c0d9381a..dfe58a1e 100644
--- a/extension/revtwoway.c
+++ b/extension/revtwoway.c
@@ -7,7 +7,7 @@
*/
/*
- * Copyright (C) 2012-2014 the Free Software Foundation, Inc.
+ * Copyright (C) 2012-2014, 2016 the Free Software Foundation, Inc.
*
* This file is part of GAWK, the GNU implementation of the
* AWK Programming Language.
@@ -64,10 +64,10 @@ int plugin_is_GPL_compatible;
static size_t max_fds;
#ifndef HAVE_GETDTABLESIZE
-/* getdtablesize --- replacement version that should be good enough */
+/* gawk_getdtablesize --- replacement version that should be good enough */
static inline int
-getdtablesize()
+gawk_getdtablesize()
{
/*
* Algorithm for the GNULIB folks:
@@ -89,6 +89,8 @@ getdtablesize()
/* In the meantime, this is good enough for us: */
return 1024;
}
+
+#define getdtablesize() gawk_getdtablesize()
#endif
/*
diff --git a/gawkapi.c b/gawkapi.c
index 8ee6543b..8b834002 100644
--- a/gawkapi.c
+++ b/gawkapi.c
@@ -238,11 +238,10 @@ api_lintwarn(awk_ext_id_t id, const char *format, ...)
va_start(args, format);
if (lintwarn == r_fatal) {
err(true, _("fatal: "), format, args);
- va_end(args);
} else {
err(false, _("warning: "), format, args);
- va_end(args);
}
+ va_end(args);
}
/* api_register_input_parser --- register an input_parser; for opening files read-only */
diff --git a/mpfr.c b/mpfr.c
index f3905cd2..da6f3837 100644
--- a/mpfr.c
+++ b/mpfr.c
@@ -377,7 +377,7 @@ mpg_format_val(const char *format, int index, NODE *s)
} else {
r = format_tree(format, fmt_list[index]->stlen, dummy, 2);
assert(r != NULL);
- s->stfmt = (char) index;
+ s->stfmt = index;
}
s->flags = oflags;
s->stlen = r->stlen;
diff --git a/node.c b/node.c
index 49d053d4..587daaf5 100644
--- a/node.c
+++ b/node.c
@@ -246,7 +246,7 @@ r_format_val(const char *format, int index, NODE *s)
} else {
r = format_tree(format, fmt_list[index]->stlen, dummy, 2);
assert(r != NULL);
- s->stfmt = (char) index;
+ s->stfmt = index;
}
s->flags = oflags;
s->stlen = r->stlen;
diff --git a/pc/ChangeLog b/pc/ChangeLog
index 4154fcba..dc38023f 100644
--- a/pc/ChangeLog
+++ b/pc/ChangeLog
@@ -1,3 +1,7 @@
+2016-07-01 Scott Deifik <scottd.mail@sbcglobal.net>
+
+ * Makefile.tst: Sync with mainline.
+
2016-06-14 Arnold D. Robbins <arnold@skeeve.com>
* Makefile.tst: Sync with mainline:
diff --git a/pc/Makefile.tst b/pc/Makefile.tst
index e4414294..ea711413 100644
--- a/pc/Makefile.tst
+++ b/pc/Makefile.tst
@@ -148,12 +148,12 @@ BASIC_TESTS = \
datanonl defref delargv delarpm2 delarprm delfunc dfamb1 dfastress dynlj \
eofsplit exit2 exitval1 exitval2 exitval3 \
fcall_exit fcall_exit2 fldchg fldchgnf fnamedat fnarray fnarray2 \
- fnaryscl fnasgnm fnmisc fordel forref forsimp fsbs fsrs fsspcoln \
+ fnaryscl fnasgnm fnmisc fordel forref forsimp fsbs fsnul1 fsrs fsspcoln \
fstabplus funsemnl funsmnam funstack \
getline getline2 getline3 getline4 getline5 getlnbuf getnr2tb getnr2tm \
gsubasgn gsubtest gsubtst2 gsubtst3 gsubtst4 gsubtst5 gsubtst6 \
gsubtst7 gsubtst8 \
- hex hsprint \
+ hex hex2 hsprint \
inpref inputred intest intprec iobug1 \
leaddig leadnl litoct longsub longwrds \
manglprm math membug1 messages minusstr mmap8k mtchi18n \
@@ -1289,7 +1289,6 @@ symtab10:
@echo $@
@AWKPATH="$(srcdir)" $(AWK) -D -f $@.awk < "$(srcdir)/$@.in" >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
-
Gt-dummy:
# file Maketests, generated from Makefile.am by the Gentests program
addcomma:
@@ -1608,6 +1607,11 @@ fsbs:
@AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+fsnul1:
+ @echo $@
+ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+
fsrs:
@echo $@
@AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@@ -1703,6 +1707,11 @@ hex:
@AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+hex2:
+ @echo $@
+ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+
hsprint:
@echo $@
@AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
diff --git a/test/ChangeLog b/test/ChangeLog
index 5f2d683f..57b23ab7 100644
--- a/test/ChangeLog
+++ b/test/ChangeLog
@@ -1,3 +1,8 @@
+2016-07-01 Arnold D. Robbins <arnold@skeeve.com>
+
+ * arrayind1.awk, arrayind1.ok: Comment out prints to stderr to
+ avoid buffer flushing on obscure systems.
+
2016-06-14 Arnold D. Robbins <arnold@skeeve.com>
* Makefile.am (subback): New test.
diff --git a/test/arrayind1.awk b/test/arrayind1.awk
index fc3683f0..5d4a6f3d 100755
--- a/test/arrayind1.awk
+++ b/test/arrayind1.awk
@@ -57,7 +57,7 @@ END{
#printf("%10s%16s%10s%16s%10s%10s%10s\n","group",last," included as",posout[x]," as sire, as dam",cum[x,"sire"],cum[x,"dam"]) > "/dev/stderr"
}
# regular individuals
- printf("%16s\n","recoding animals") > "/dev/stderr"
+# printf("%16s\n","recoding animals") > "/dev/stderr"
iter=1
#--> comment next line and this element of the associative array becomes null
#printf("%s%16s\n","at the beginning it should be empty: ",posout["00000779770060"]) > "/dev/stderr"
@@ -84,8 +84,8 @@ END{
}
iter++
#-->
- printf("%s%16s\n","in the loop: ",posout["00000779770060"]) > "/dev/stderr"
- fflush("/dev/stderr")
+# printf("%s%16s\n","in the loop: ",posout["00000779770060"]) > "/dev/stderr"
+# fflush("/dev/stderr")
#-->
#printf("%10s%10s%10s%10s%16s%16s\n","round",iter,"included",posout[last],"last ",last) > "/dev/stderr"
}
@@ -95,7 +95,7 @@ END{
#printf("%10s%16s%10s%16s\n","pseudogeneration:",x," including: ",cumgen[x]) > "/dev/stderr"
}
#--> this is the guilty line
- printf("%s%16s\n","at the end: ",posout["00000779770060"]) > "/dev/stderr"
- fflush("/dev/stderr")
+# printf("%s%16s\n","at the end: ",posout["00000779770060"]) > "/dev/stderr"
+# fflush("/dev/stderr")
#-->
}
diff --git a/test/arrayind1.ok b/test/arrayind1.ok
index c68346ea..2b11bb5d 100644
--- a/test/arrayind1.ok
+++ b/test/arrayind1.ok
@@ -1,8 +1,3 @@
-recoding animals
-in the loop: 3
-in the loop: 3
-in the loop: 3
-at the end: 3
1 0 0 00000757740011 0 0 0
2 0 0 1975su1du1 0 0 0
3 2 2 00000779770060 1975su1du1 1975su1du1 1