From f35c3be9f8968daaa1b3e81808f9b99079d17a68 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Mon, 16 Apr 2018 07:34:18 +0200 Subject: Remove register keyword from public header files MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The following code void f(void) { register int i; } gives a warning with GCC and -std=c++17 test.cc: In function ‘void f()’: test.cc:3:15: warning: ISO C++1z does not allow ‘register’ storage class specifier [-Wregister] register int i; ^ and clang with -std=c++14 test.cc:3:3: warning: 'register' storage class specifier is deprecated and incompatible with C++1z [-Wdeprecated-register] register int i; ^~~~~~~~~ 1 warning generated. Remove the use of the register keyword at least in the public header files for C++ compatibility. Close #3397. --- cpukit/score/cpu/lm32/include/rtems/score/lm32.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'cpukit/score/cpu/lm32') diff --git a/cpukit/score/cpu/lm32/include/rtems/score/lm32.h b/cpukit/score/cpu/lm32/include/rtems/score/lm32.h index e8fecdf2f6..70d8bab735 100644 --- a/cpukit/score/cpu/lm32/include/rtems/score/lm32.h +++ b/cpukit/score/cpu/lm32/include/rtems/score/lm32.h @@ -73,7 +73,7 @@ extern "C" { __asm__ volatile ("rcsr %0, ip":"=r"(_ip)); #define lm32_disable_interrupts( _level ) \ - do { register uint32_t ie; \ + do { uint32_t ie; \ __asm__ volatile ("rcsr %0,ie":"=r"(ie)); \ (_level) = ie; \ ie &= (~0x0001); \ @@ -84,28 +84,28 @@ extern "C" { __asm__ volatile ("wcsr ie,%0"::"r"(_level)); #define lm32_flash_interrupts( _level ) \ - do { register uint32_t ie; \ + do { uint32_t ie; \ __asm__ volatile ("wcsr ie,%0"::"r"(_level)); \ ie = (_level) & (~0x0001); \ __asm__ volatile ("wcsr ie,%0"::"r"(ie)); \ } while (0) #define lm32_interrupt_unmask( _mask ) \ - do { register uint32_t im; \ + do { uint32_t im; \ __asm__ volatile ("rcsr %0,im":"=r"(im)); \ im |= _mask; \ __asm__ volatile ("wcsr im,%0"::"r"(im)); \ } while (0) #define lm32_interrupt_mask( _mask ) \ - do { register uint32_t im; \ + do { uint32_t im; \ __asm__ volatile ("rcsr %0,im":"=r"(im)); \ im &= ~(_mask); \ __asm__ volatile ("wcsr im,%0"::"r"(im)); \ } while (0) #define lm32_interrupt_ack( _mask ) \ - do { register uint32_t ip = _mask; \ + do { uint32_t ip = _mask; \ __asm__ volatile ("wcsr ip,%0"::"r"(ip)); \ } while (0) -- cgit v1.2.3