Patchwork [4/5] linux-low: Remove usage of "register" keyword

login
register
mail settings
Submitter Simon Marchi
Date June 10, 2017, 7:58 p.m.
Message ID <1497124689-11842-5-git-send-email-simon.marchi@ericsson.com>
Download mbox | patch
Permalink /patch/20907/
State New
Headers show

Comments

Simon Marchi - June 10, 2017, 7:58 p.m.
AFAIK, the register keyword is not relevant today, and clang complains
about it:

/home/emaisin/src/binutils-gdb/gdb/gdbserver/linux-low.c:5873:3: error: 'register' storage class specifier is deprecated and incompatible with C++1z
      [-Werror,-Wdeprecated-register]
  register PTRACE_XFER_TYPE *buffer;
  ^~~~~~~~~

I think we can safely remove it.

gdb/gdbserver/ChangeLog:

	* linux-low.c (linux_read_memory, linux_write_memory): Remove
	usage of "register" keyword.
---
 gdb/gdbserver/linux-low.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

Patch

diff --git a/gdb/gdbserver/linux-low.c b/gdb/gdbserver/linux-low.c
index 7fbf744..c8e8d08 100644
--- a/gdb/gdbserver/linux-low.c
+++ b/gdb/gdbserver/linux-low.c
@@ -5870,11 +5870,11 @@  static int
 linux_read_memory (CORE_ADDR memaddr, unsigned char *myaddr, int len)
 {
   int pid = lwpid_of (current_thread);
-  register PTRACE_XFER_TYPE *buffer;
-  register CORE_ADDR addr;
-  register int count;
+  PTRACE_XFER_TYPE *buffer;
+  CORE_ADDR addr;
+  int count;
   char filename[64];
-  register int i;
+  int i;
   int ret;
   int fd;
 
@@ -5958,16 +5958,16 @@  linux_read_memory (CORE_ADDR memaddr, unsigned char *myaddr, int len)
 static int
 linux_write_memory (CORE_ADDR memaddr, const unsigned char *myaddr, int len)
 {
-  register int i;
+  int i;
   /* Round starting address down to longword boundary.  */
-  register CORE_ADDR addr = memaddr & -(CORE_ADDR) sizeof (PTRACE_XFER_TYPE);
+  CORE_ADDR addr = memaddr & -(CORE_ADDR) sizeof (PTRACE_XFER_TYPE);
   /* Round ending address up; get number of longwords that makes.  */
-  register int count
+  int count
     = (((memaddr + len) - addr) + sizeof (PTRACE_XFER_TYPE) - 1)
     / sizeof (PTRACE_XFER_TYPE);
 
   /* Allocate buffer of that many longwords.  */
-  register PTRACE_XFER_TYPE *buffer = XALLOCAVEC (PTRACE_XFER_TYPE, count);
+  PTRACE_XFER_TYPE *buffer = XALLOCAVEC (PTRACE_XFER_TYPE, count);
 
   int pid = lwpid_of (current_thread);