aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2021-02-15 20:33:15 +0200
committerArnold D. Robbins <arnold@skeeve.com>2021-02-15 20:33:15 +0200
commitc0f4e97e4561ff42544e92512bbaf3d7d1f6a671 (patch)
treebbd2a32876192507dce4bd0ad6a30f0abd3b02b4
parent178f660b5a4fde6f39e8065185373166f55b6e0c (diff)
downloadone-true-awk-c0f4e97e4561ff42544e92512bbaf3d7d1f6a671.tar.gz
Fix compiling with g++.
-rw-r--r--FIXES4
-rw-r--r--main.c2
-rw-r--r--tran.c4
3 files changed, 7 insertions, 3 deletions
diff --git a/FIXES b/FIXES
index 82c8f8f..516458e 100644
--- a/FIXES
+++ b/FIXES
@@ -25,6 +25,10 @@ THIS SOFTWARE.
This file lists all bug fixes, changes, etc., made since the AWK book
was sent to the printers in August, 1987.
+February 15, 2021:
+ Small fix so that awk will compile again with g++. Thanks to
+ Arnold Robbins.
+
January 06, 2021:
Fix a decision bug with trailing stuff in lib.c:is_valid_number
after recent changes. Thanks to Ozan Yigit.
diff --git a/main.c b/main.c
index 2b1d64c..f393634 100644
--- a/main.c
+++ b/main.c
@@ -22,7 +22,7 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
THIS SOFTWARE.
****************************************************************/
-const char *version = "version 20210106";
+const char *version = "version 20210215";
#define DEBUG
#include <stdio.h>
diff --git a/tran.c b/tran.c
index add9d85..c6ae890 100644
--- a/tran.c
+++ b/tran.c
@@ -418,7 +418,7 @@ Awkfloat getfval(Cell *vp) /* get float val of a Cell */
return(vp->fval);
}
-static char *get_inf_nan(double d)
+static const char *get_inf_nan(double d)
{
if (isinf(d)) {
return (d < 0 ? "-inf" : "+inf");
@@ -432,7 +432,7 @@ static char *get_str_val(Cell *vp, char **fmt) /* get string val of a Cel
{
char s[256];
double dtemp;
- char *p;
+ const char *p;
if ((vp->tval & (NUM | STR)) == 0)
funnyvar(vp, "read value of");