changeset 21332:db574711df78

eliminate deprecated register storage class specifier * colamd.cc, randmtzig.c: Don't declare variables with register storage class specifier. * libinterp/parse-tree/module.mk (libinterp/parse-tree/oct-gperf.h): Filter out register storage class specifier from generated code. * oct-tex-lexer.in.ll, lex.ll: Define away register storage class specifier.
author John W. Eaton <jwe@octave.org>
date Wed, 24 Feb 2016 09:52:27 -0500
parents ca084a8b64c3
children c4690d9ff566
files libinterp/corefcn/oct-tex-lexer.in.ll libinterp/dldfcn/colamd.cc libinterp/parse-tree/lex.ll libinterp/parse-tree/module.mk liboctave/numeric/randmtzig.c
diffstat 5 files changed, 17 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/libinterp/corefcn/oct-tex-lexer.in.ll	Wed Feb 24 09:49:12 2016 -0500
+++ b/libinterp/corefcn/oct-tex-lexer.in.ll	Wed Feb 24 09:52:27 2016 -0500
@@ -36,6 +36,12 @@
 #pragma GCC diagnostic ignored "-Wold-style-cast"
 #endif
 
+// Define away the deprecated register storage class specifier to avoid
+// potential warnings about it.
+#if ! defined (register)
+#define register
+#endif
+
 }
 
 %option prefix = "octave_tex_"
--- a/libinterp/dldfcn/colamd.cc	Wed Feb 24 09:49:12 2016 -0500
+++ b/libinterp/dldfcn/colamd.cc	Wed Feb 24 09:52:27 2016 -0500
@@ -111,10 +111,8 @@
 static inline octave_idx_type
 find (octave_idx_type i, octave_idx_type *pp)
 {
-  register octave_idx_type p, gp;
-
-  p = pp[i];
-  gp = pp[p];
+  octave_idx_type p = pp[i];
+  octave_idx_type gp = pp[p];
 
   while (gp != p)
     {
--- a/libinterp/parse-tree/lex.ll	Wed Feb 24 09:49:12 2016 -0500
+++ b/libinterp/parse-tree/lex.ll	Wed Feb 24 09:52:27 2016 -0500
@@ -47,6 +47,12 @@
 #pragma GCC diagnostic ignored "-Wold-style-cast"
 #endif
 
+// Define away the deprecated register storage class specifier to avoid
+// potential warnings about it.
+#if ! defined (register)
+#define register
+#endif
+
 }
 
 %option prefix = "octave_"
--- a/libinterp/parse-tree/module.mk	Wed Feb 24 09:49:12 2016 -0500
+++ b/libinterp/parse-tree/module.mk	Wed Feb 24 09:52:27 2016 -0500
@@ -82,7 +82,7 @@
 libinterp/parse-tree/oct-gperf.h: libinterp/parse-tree/octave.gperf
 	$(AM_V_GEN)rm -f $@-t $@t1 $@ && \
 	$(GPERF) -t -C -D -G -L C++ -Z octave_kw_hash $< > $@-t1 && \
-	$(SED) 's,lookup\[,gperf_lookup[,' < $@-t1 > $@-t && \
+	$(SED) -e 's,lookup\[,gperf_lookup[,' -e 's,register ,,g' < $@-t1 > $@-t && \
 	mv $@-t $@ && \
 	rm -f $@-t1
 
--- a/liboctave/numeric/randmtzig.c	Wed Feb 24 09:49:12 2016 -0500
+++ b/liboctave/numeric/randmtzig.c	Wed Feb 24 09:52:27 2016 -0500
@@ -339,7 +339,7 @@
 static uint32_t
 randmt (void)
 {
-  register uint32_t y;
+  uint32_t y;
 
   if (--left == 0)
     next_state ();
@@ -581,7 +581,7 @@
       /* 53-bit mantissa, 1-bit sign, x86 32-bit architecture */
       double x;
       int si,idx;
-      register uint32_t lo, hi;
+      uint32_t lo, hi;
       int64_t rabs;
       uint32_t *p = (uint32_t *)&rabs;
       lo = randi32 ();