gawk-diffs
[Top][All Lists]
Advanced

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

[gawk-diffs] [SCM] gawk branch, gawk-4.1-stable, updated. gawk-4.1.0-525


From: Arnold Robbins
Subject: [gawk-diffs] [SCM] gawk branch, gawk-4.1-stable, updated. gawk-4.1.0-525-g2513062
Date: Sun, 23 Nov 2014 17:56:52 +0000

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-4.1-stable has been updated
       via  2513062a4c89b0b60c3717d506fce841d44d871e (commit)
      from  838f65088cda84edc2df609d3e388acb3c8eb13d (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=2513062a4c89b0b60c3717d506fce841d44d871e

commit 2513062a4c89b0b60c3717d506fce841d44d871e
Author: Arnold D. Robbins <address@hidden>
Date:   Sun Nov 23 19:56:27 2014 +0200

    Fix compile problems and warnings on current GCC (4.9.2).

diff --git a/ChangeLog b/ChangeLog
index c24ecd3..f47aede 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2014-11-23         Arnold D. Robbins     <address@hidden>
+
+       * awk.h: Move all inline functions to the bottom of the file.
+       Keeps modern GCC happier.
+
 2014-11-22         Arnold D. Robbins     <address@hidden>
 
        * awk.h (emalloc, realloc): Redefine in terms of ...
diff --git a/awk.h b/awk.h
index 84c8ca0..3abad6f 100644
--- a/awk.h
+++ b/awk.h
@@ -1245,74 +1245,12 @@ DEREF(NODE *r)
 #define        cant_happen()   r_fatal("internal error line %d, file: %s", \
                                __LINE__, __FILE__)
 
-#define fatal          set_loc(__FILE__, __LINE__), r_fatal
-
-static inline void *
-emalloc_real(size_t count, const char *where, const char *var, const char 
*file, int line)
-{
-       void *ret;
-
-       if (count == 0)
-               fatal("%s:%d: emalloc called with zero bytes", file, line);
-
-       ret = (void *) malloc(count);
-       if (ret == NULL)
-               fatal(_("%s:%d:%s: %s: can't allocate %ld bytes of memory 
(%s)"),
-                       file, line, where, var, (long) count, strerror(errno));
-
-       return ret;
-}
-
-static inline void *
-erealloc_real(void *ptr, size_t count, const char *where, const char *var, 
const char *file, int line)
-{
-       void *ret;
-
-       if (count == 0)
-               fatal("%s:%d: erealloc called with zero bytes", file, line);
-
-       ret = (void *) realloc(ptr, count);
-       if (ret == NULL)
-               fatal(_("%s:%d:%s: %s: can't reallocate %ld bytes of memory 
(%s)"),
-                       file, line, where, var, (long) count, strerror(errno));
-
-       return ret;
-}
-
 #define        emalloc(var,ty,x,str)   (void) (var = (ty) 
emalloc_real((size_t)(x), str, #var, __FILE__, __LINE__))
 #define        erealloc(var,ty,x,str)  (void) (var = (ty) erealloc_real((void 
*) var, (size_t)(x), str, #var, __FILE__, __LINE__))
 
 #define efree(p)       free(p)
 
-static inline NODE *
-force_string(NODE *s)
-{
-       if ((s->flags & STRCUR) != 0
-                   && (s->stfmt == -1 || s->stfmt == CONVFMTidx)
-       )
-               return s;
-       return format_val(CONVFMT, CONVFMTidx, s);
-}
-
-#ifdef GAWKDEBUG
-#define unref  r_unref
-#define        force_number    str2number
-#else /* not GAWKDEBUG */
-
-static inline void
-unref(NODE *r)
-{
-       if (r != NULL && --r->valref <= 0)
-               r_unref(r);
-}
-
-static inline NODE *
-force_number(NODE *n)
-{
-       return (n->flags & NUMCUR) ? n : str2number(n);
-}
-
-#endif /* GAWKDEBUG */
+#define fatal          set_loc(__FILE__, __LINE__), r_fatal
 
 extern jmp_buf fatal_tag;
 extern bool fatal_tag_valid;
@@ -1800,3 +1738,65 @@ dupnode(NODE *n)
        return r_dupnode(n);
 }
 #endif
+
+static inline NODE *
+force_string(NODE *s)
+{
+       if ((s->flags & STRCUR) != 0
+                   && (s->stfmt == -1 || s->stfmt == CONVFMTidx)
+       )
+               return s;
+       return format_val(CONVFMT, CONVFMTidx, s);
+}
+
+#ifdef GAWKDEBUG
+#define unref  r_unref
+#define        force_number    str2number
+#else /* not GAWKDEBUG */
+
+static inline void
+unref(NODE *r)
+{
+       if (r != NULL && --r->valref <= 0)
+               r_unref(r);
+}
+
+static inline NODE *
+force_number(NODE *n)
+{
+       return (n->flags & NUMCUR) ? n : str2number(n);
+}
+
+#endif /* GAWKDEBUG */
+
+static inline void *
+emalloc_real(size_t count, const char *where, const char *var, const char 
*file, int line)
+{
+       void *ret;
+
+       if (count == 0)
+               fatal("%s:%d: emalloc called with zero bytes", file, line);
+
+       ret = (void *) malloc(count);
+       if (ret == NULL)
+               fatal(_("%s:%d:%s: %s: can't allocate %ld bytes of memory 
(%s)"),
+                       file, line, where, var, (long) count, strerror(errno));
+
+       return ret;
+}
+
+static inline void *
+erealloc_real(void *ptr, size_t count, const char *where, const char *var, 
const char *file, int line)
+{
+       void *ret;
+
+       if (count == 0)
+               fatal("%s:%d: erealloc called with zero bytes", file, line);
+
+       ret = (void *) realloc(ptr, count);
+       if (ret == NULL)
+               fatal(_("%s:%d:%s: %s: can't reallocate %ld bytes of memory 
(%s)"),
+                       file, line, where, var, (long) count, strerror(errno));
+
+       return ret;
+}
diff --git a/extension/ChangeLog b/extension/ChangeLog
index 940f7f1..41c8a0e 100644
--- a/extension/ChangeLog
+++ b/extension/ChangeLog
@@ -1,3 +1,8 @@
+2014-11-23         Arnold D. Robbins     <address@hidden>
+
+       * inplace.c (do_inplace_begin): Jump through hoops to silence
+       GCC warnings about return value of chown.
+
 2014-10-12         Arnold D. Robbins     <address@hidden>
 
        * Makefile.am (uninstall-so): Remove *.lib too, per suggestion
diff --git a/extension/inplace.c b/extension/inplace.c
index 8a7375c..0693ad9 100644
--- a/extension/inplace.c
+++ b/extension/inplace.c
@@ -170,8 +170,12 @@ do_inplace_begin(int nargs, awk_value_t *result)
                        state.tname, strerror(errno));
 
        /* N.B. chown/chmod should be more portable than fchown/fchmod */
-       if (chown(state.tname, sbuf.st_uid, sbuf.st_gid) < 0)
-               (void) chown(state.tname, -1, sbuf.st_gid);
+       if (chown(state.tname, sbuf.st_uid, sbuf.st_gid) < 0) {
+               /* jumping through hoops to silence gcc. :-( */
+               int junk;
+               junk = chown(state.tname, -1, sbuf.st_gid);
+               junk = junk;
+       }
 
        if (chmod(state.tname, sbuf.st_mode) < 0)
                fatal(ext_id, _("inplace_begin: chmod failed (%s)"),

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

Summary of changes:
 ChangeLog           |    5 ++
 awk.h               |  126 +++++++++++++++++++++++++-------------------------
 extension/ChangeLog |    5 ++
 extension/inplace.c |    8 +++-
 4 files changed, 79 insertions(+), 65 deletions(-)


hooks/post-receive
-- 
gawk



reply via email to

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