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/sh/include/rtems/score/sh.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'cpukit/score/cpu/sh/include/rtems/score') diff --git a/cpukit/score/cpu/sh/include/rtems/score/sh.h b/cpukit/score/cpu/sh/include/rtems/score/sh.h index 4e26478b8b..6ac5ef1382 100644 --- a/cpukit/score/cpu/sh/include/rtems/score/sh.h +++ b/cpukit/score/cpu/sh/include/rtems/score/sh.h @@ -170,7 +170,7 @@ extern "C" { #define sh_get_interrupt_level( _level ) \ { \ - register uint32_t _tmpsr ; \ + uint32_t _tmpsr ; \ \ __asm__ volatile( "stc sr, %0" : "=r" (_tmpsr) ); \ _level = (_tmpsr & 0xf0) >> 4 ; \ @@ -178,7 +178,7 @@ extern "C" { #define sh_set_interrupt_level( _newlevel ) \ { \ - register uint32_t _tmpsr; \ + uint32_t _tmpsr; \ \ __asm__ volatile ( "stc sr, %0" : "=r" (_tmpsr) ); \ _tmpsr = ( _tmpsr & ~0xf0 ) | ((_newlevel) << 4) ; \ @@ -194,7 +194,7 @@ static inline uint32_t sh_swap_u32( uint32_t value ) { - register uint32_t swapped; + uint32_t swapped; __asm__ volatile ( "swap.b %1,%0; " @@ -210,7 +210,7 @@ static inline uint16_t sh_swap_u16( uint16_t value ) { - register uint16_t swapped ; + uint16_t swapped ; __asm__ volatile ( "swap.b %1,%0" : "=r" (swapped) : "r" (value) ); -- cgit v1.2.3