@@ -300,6 +300,13 @@ static __INLINE void __set_FPSCR(uint32_t fpscr)
300
300
#elif defined ( __GNUC__ ) /* ------------------ GNU Compiler ---------------------*/
301
301
/* GNU gcc specific functions */
302
302
303
+ /* C++17 removes register keyword */
304
+ #if __cplusplus >= 201703L
305
+ # define DEPRECATED_REGISTER
306
+ #else
307
+ # define DEPRECATED_REGISTER register
308
+ #endif
309
+
303
310
/* * \brief Enable IRQ Interrupts
304
311
305
312
This function enables IRQ interrupts by clearing the I-bit in the CPSR.
@@ -402,7 +409,7 @@ __attribute__( ( always_inline ) ) static __INLINE uint32_t __get_xPSR(void)
402
409
*/
403
410
__attribute__ ( ( always_inline ) ) static __INLINE uint32_t __get_PSP(void )
404
411
{
405
- register uint32_t result ;
412
+ DEPRECATED_REGISTER uint32_t result;
406
413
407
414
__ASM volatile (" MRS %0, psp\n " : " =r" (result) );
408
415
return (result);
@@ -429,7 +436,7 @@ __attribute__( ( always_inline ) ) static __INLINE void __set_PSP(uint32_t topOf
429
436
*/
430
437
__attribute__ ( ( always_inline ) ) static __INLINE uint32_t __get_MSP(void )
431
438
{
432
- register uint32_t result ;
439
+ DEPRECATED_REGISTER uint32_t result;
433
440
434
441
__ASM volatile (" MRS %0, msp\n " : " =r" (result) );
435
442
return (result);
@@ -591,6 +598,8 @@ __attribute__( ( always_inline ) ) static __INLINE void __set_FPSCR(uint32_t fps
591
598
592
599
#endif /* (__CORTEX_M == 0x04) */
593
600
601
+ #undef DEPRECATED_REGISTER
602
+
594
603
595
604
#elif defined ( __TASKING__ ) /* ------------------ TASKING Compiler --------------*/
596
605
/* TASKING carm specific functions */
0 commit comments