[PATCH] Fix gcc-11 compiler warnings on gdb-10.2/gdb/symtab.c

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

 



Without the patch, the following gcc-11 compiler warnings are emitted
for gdb-10.2/gdb/symtab.c:

symtab.c: In function 'void gdb_get_datatype(gnu_request*)':
symtab.c:7131:31: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
  7131 |         register struct type *type;
       |                               ^~~~
symtab.c:7132:31: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
  7132 |         register struct type *typedef_type;
       |                               ^~~~~~~~~~~~
...

Usually we don't fix compiler warnings for gdb, but these are emitted
even by "make clean ; make warn", which doesn't recompile the whole
gdb, so it would be better to fix.

Signed-off-by: Kazuhito Hagio <k-hagio-ab@xxxxxxx>
---
  gdb-10.2.patch | 41 +++++++++++++++++++++++++++++++++++++++++
  1 file changed, 41 insertions(+)

diff --git a/gdb-10.2.patch b/gdb-10.2.patch
index 577f5e45fc5a..29c19c416bfd 100644
--- a/gdb-10.2.patch
+++ b/gdb-10.2.patch
@@ -9,6 +9,7 @@
  # to all subsequent patch applications.
  
  tar xvzmf gdb-10.2.tar.gz \
+	gdb-10.2/gdb/symtab.c \
  	gdb-10.2/gdb/Makefile.in
  
  exit 0
@@ -1650,3 +1651,43 @@ exit 0
  
   	  c_print_type_1 (type->field (i).type (),
   			  TYPE_FIELD_NAME (type, i),
+--- gdb-10.2/gdb/symtab.c.orig
++++ gdb-10.2/gdb/symtab.c
+@@ -7128,8 +7128,8 @@ gdb_get_line_number(struct gnu_request *
+ static void
+ gdb_get_datatype(struct gnu_request *req)
+ {
+-        register struct type *type;
+-        register struct type *typedef_type;
++        struct type *type;
++        struct type *typedef_type;
+         expression_up expr;
+         struct symbol *sym;
+         struct value *val;
+@@ -7235,7 +7235,7 @@ gdb_get_datatype(struct gnu_request *req
+ static void
+ dump_enum(struct type *type, struct gnu_request *req)
+ {
+-        register int i;
++        int i;
+         int len;
+         long long lastval;
+
+@@ -7271,7 +7271,7 @@ dump_enum(struct type *type, struct gnu_
+ static void
+ eval_enum(struct type *type, struct gnu_request *req)
+ {
+-        register int i;
++        int i;
+         int len;
+         long long lastval;
+
+@@ -7298,7 +7298,7 @@ eval_enum(struct type *type, struct gnu_
+ static void
+ get_member_data(struct gnu_request *req, struct type *type, long offset, int is_first)
+ {
+-        register short i;
++        short i;
+         struct field *nextfield;
+         short nfields;
+         struct type *typedef_type, *target_type;
-- 
2.31.1
--
Crash-utility mailing list
Crash-utility@xxxxxxxxxx
https://listman.redhat.com/mailman/listinfo/crash-utility
Contribution Guidelines: https://github.com/crash-utility/crash/wiki




[Index of Archives]     [Fedora Development]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [KDE Users]     [Fedora Tools]

 

Powered by Linux