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/powerpc/include/rtems/score/cpu.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'cpukit/score/cpu/powerpc/include/rtems/score/cpu.h') diff --git a/cpukit/score/cpu/powerpc/include/rtems/score/cpu.h b/cpukit/score/cpu/powerpc/include/rtems/score/cpu.h index 02560695bd..31e74aba95 100644 --- a/cpukit/score/cpu/powerpc/include/rtems/score/cpu.h +++ b/cpukit/score/cpu/powerpc/include/rtems/score/cpu.h @@ -661,7 +661,7 @@ RTEMS_INLINE_ROUTINE bool _CPU_ISR_Is_enabled( uint32_t level ) static inline uint32_t _CPU_ISR_Get_level( void ) { - register unsigned int msr; + uint32_t msr; _CPU_MSR_GET(msr); if (msr & MSR_EE) return 0; else return 1; @@ -669,7 +669,7 @@ static inline uint32_t _CPU_ISR_Get_level( void ) static inline void _CPU_ISR_Set_level( uint32_t level ) { - register unsigned int msr; + uint32_t msr; _CPU_MSR_GET(msr); if (!(level & CPU_MODES_INTERRUPT_MASK)) { msr |= ppc_interrupt_get_disable_mask(); -- cgit v1.2.3