gawk-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[SCM] gawk branch, gawk-5.3-stable, updated. gawk-4.1.0-5499-ga3e53973


From: Arnold Robbins
Subject: [SCM] gawk branch, gawk-5.3-stable, updated. gawk-4.1.0-5499-ga3e53973
Date: Fri, 9 Aug 2024 01:48:43 -0400 (EDT)

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "gawk".

The branch, gawk-5.3-stable has been updated
       via  a3e5397339245d0637304647081ef6b2c1bb343c (commit)
      from  c6e97e72bf931e3f2ebfafcc892e9d86dff695a1 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.sv.gnu.org/cgit/gawk.git/commit/?id=a3e5397339245d0637304647081ef6b2c1bb343c

commit a3e5397339245d0637304647081ef6b2c1bb343c
Author: Arnold D. Robbins <arnold@skeeve.com>
Date:   Fri Aug 9 08:48:21 2024 +0300

    Clean up some compiler warnings.

diff --git a/ChangeLog b/ChangeLog
index 358d3274..eb2e55e3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2024-08-09         Arnold D. Robbins     <arnold@skeeve.com>
+
+       Thanks to Michal Jaegermann for tips on removing
+       compiler warnings:
+
+       * eval.c (opcode2str): Return "" instead of NULL.
+       (cmp_doubles): Default ret to false and add a default case
+       to the switch.
+       * printf.c (format_signed_integer): Add some additional
+       parentheses.
+
 2024-08-06         Arnold D. Robbins     <arnold@skeeve.com>
 
        * printf.c (format_unsigned_integer, format_signed_integer):
diff --git a/eval.c b/eval.c
index b931bbfa..266578fa 100644
--- a/eval.c
+++ b/eval.c
@@ -414,7 +414,7 @@ opcode2str(OPCODE op)
        if (op >= Op_illegal && op < Op_final)
                return optypes[(int) op].desc;
        fatal(_("unknown opcode %d"), (int) op);
-       return NULL;
+       return "";      // keeps the compiler happy in some cases
 }
 
 /* op2str --- convert an opcode type to corresponding operator or keyword */
@@ -1612,7 +1612,7 @@ cmp_doubles(const NODE *t1, const NODE *t2, scalar_cmp_t 
comparison_type)
 
        bool t1_nan = isnan(t1->numbr);
        bool t2_nan = isnan(t2->numbr);
-       int ret;
+       int ret = false;
 
        if ((t1_nan || t2_nan) && comparison_type != SCALAR_NEQ)
                return false;
@@ -1636,6 +1636,9 @@ cmp_doubles(const NODE *t1, const NODE *t2, scalar_cmp_t 
comparison_type)
        case SCALAR_GE:
                ret = (t1->numbr >= t2->numbr);
                break;
+       default:
+               cant_happen("invalid value %d in cmp_doubles", (int) 
comparison_type);
+               break;
        }
 
        return ret;
diff --git a/printf.c b/printf.c
index 5c604a92..ebd48bd4 100644
--- a/printf.c
+++ b/printf.c
@@ -1024,7 +1024,7 @@ format_signed_integer(NODE *arg, struct flags *flags)
                return add_plus_or_space_and_fill(number_value, flags);
        } else if (flags->have_prec &&
                        (val_len < flags->precision ||
-                        flags->negative && val_len - 1 < flags->precision)) {
+                        (flags->negative && val_len - 1 < flags->precision))) {
                buf1 = zero_fill_to_precision(number_value, flags);
                val_len = strlen(buf1);
 

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog | 11 +++++++++++
 eval.c    |  7 +++++--
 printf.c  |  2 +-
 3 files changed, 17 insertions(+), 3 deletions(-)


hooks/post-receive
-- 
gawk



reply via email to

[Prev in Thread] Current Thread [Next in Thread]