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/mips/include/rtems/score/mips.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'cpukit/score/cpu/mips') diff --git a/cpukit/score/cpu/mips/include/rtems/score/mips.h b/cpukit/score/cpu/mips/include/rtems/score/mips.h index 4c2c53fa6d..3b6115e9b6 100644 --- a/cpukit/score/cpu/mips/include/rtems/score/mips.h +++ b/cpukit/score/cpu/mips/include/rtems/score/mips.h @@ -136,7 +136,7 @@ extern "C" { #define mips_set_sr( _x ) \ do { \ - register unsigned int __x = (_x); \ + unsigned int __x = (_x); \ __asm__ volatile( "mtc0 %0, $12; nop" : : "r" (__x) ); \ } while (0) @@ -153,7 +153,7 @@ extern "C" { #define mips_set_cause( _x ) \ do { \ - register unsigned int __x = (_x); \ + unsigned int __x = (_x); \ __asm__ volatile( "mtc0 %0, $13; nop" : : "r" (__x) ); \ } while (0) @@ -172,7 +172,7 @@ extern "C" { #define mips_set_dcic( _x ) \ do { \ - register unsigned int __x = (_x); \ + unsigned int __x = (_x); \ __asm__ volatile( "mtc0 %0, $7; nop" : : "r" (__x) ); \ } while (0) @@ -193,8 +193,8 @@ extern "C" { #define mips_set_bpcrm( _x, _y ) \ do { \ - register unsigned int __x = (_x); \ - register unsigned int __y = (_y); \ + unsigned int __x = (_x); \ + unsigned int __y = (_y); \ __asm__ volatile( "mtc0 %0, $11; nop" : : "r" (__y) ); \ __asm__ volatile( "mtc0 %0, $3; nop" : : "r" (__x) ); \ } while (0) @@ -218,8 +218,8 @@ extern "C" { #define mips_set_bdarm( _x, _y ) \ do { \ - register unsigned int __x = (_x); \ - register unsigned int __y = (_y); \ + unsigned int __x = (_x); \ + unsigned int __y = (_y); \ __asm__ volatile( "mtc0 %0, $9; nop" : : "r" (__y) ); \ __asm__ volatile( "mtc0 %0, $5; nop" : : "r" (__x) ); \ } while (0) @@ -244,7 +244,7 @@ extern "C" { #define mips_set_fcr31( _x ) \ do { \ - register unsigned int __x = (_x); \ + unsigned int __x = (_x); \ __asm__ volatile( "ctc1 %0, $31; nop" : : "r" (__x) ); \ } while(0) -- cgit v1.2.3