Changeset f35c3be9 in rtems


Ignore:
Timestamp:
Apr 16, 2018, 5:34:18 AM (17 months ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
90013f59
Parents:
696b9121
git-author:
Sebastian Huber <sebastian.huber@…> (04/16/18 05:34:18)
git-committer:
Sebastian Huber <sebastian.huber@…> (04/16/18 05:37:06)
Message:

Remove register keyword from public header files

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.

Location:
cpukit/score/cpu
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • cpukit/score/cpu/i386/include/rtems/score/cpu.h

    r696b9121 rf35c3be9  
    523523#define _CPU_Bitfield_Find_first_bit( _value, _output ) \
    524524  { \
    525     register uint16_t __value_in_register = ( _value ); \
    526     uint16_t          __output = 0; \
     525    uint16_t __value_in_register = ( _value ); \
     526    uint16_t __output = 0; \
    527527    __asm__ volatile ( "bsfw    %0,%1 " \
    528528                    : "=r" ( __value_in_register ), "=r" ( __output ) \
  • cpukit/score/cpu/i386/include/rtems/score/i386.h

    r696b9121 rf35c3be9  
    137137static inline unsigned int i386_get_cr0(void)
    138138{
    139   register unsigned int segment = 0;
     139  unsigned int segment = 0;
    140140
    141141  __asm__ volatile ( "movl %%cr0,%0" : "=r" (segment) : "0" (segment) );
     
    151151static inline unsigned int i386_get_cr2(void)
    152152{
    153   register unsigned int segment = 0;
     153  unsigned int segment = 0;
    154154
    155155  __asm__ volatile ( "movl %%cr2,%0" : "=r" (segment) : "0" (segment) );
     
    160160static inline unsigned int i386_get_cr3(void)
    161161{
    162   register unsigned int segment = 0;
     162  unsigned int segment = 0;
    163163
    164164  __asm__ volatile ( "movl %%cr3,%0" : "=r" (segment) : "0" (segment) );
     
    244244static __inline__ unsigned short i386_get_cs(void)
    245245{
    246   register unsigned short segment = 0;
     246  unsigned short segment = 0;
    247247
    248248  __asm__ volatile ( "movw %%cs,%0" : "=r" (segment) : "0" (segment) );
     
    253253static __inline__ unsigned short i386_get_ds(void)
    254254{
    255   register unsigned short segment = 0;
     255  unsigned short segment = 0;
    256256
    257257  __asm__ volatile ( "movw %%ds,%0" : "=r" (segment) : "0" (segment) );
     
    262262static __inline__ unsigned short i386_get_es(void)
    263263{
    264   register unsigned short segment = 0;
     264  unsigned short segment = 0;
    265265
    266266  __asm__ volatile ( "movw %%es,%0" : "=r" (segment) : "0" (segment) );
     
    271271static __inline__ unsigned short i386_get_ss(void)
    272272{
    273   register unsigned short segment = 0;
     273  unsigned short segment = 0;
    274274
    275275  __asm__ volatile ( "movw %%ss,%0" : "=r" (segment) : "0" (segment) );
     
    280280static __inline__ unsigned short i386_get_fs(void)
    281281{
    282   register unsigned short segment = 0;
     282  unsigned short segment = 0;
    283283
    284284  __asm__ volatile ( "movw %%fs,%0" : "=r" (segment) : "0" (segment) );
     
    289289static __inline__ unsigned short i386_get_gs(void)
    290290{
    291   register unsigned short segment = 0;
     291  unsigned short segment = 0;
    292292
    293293  __asm__ volatile ( "movw %%gs,%0" : "=r" (segment) : "0" (segment) );
     
    301301
    302302#define i386_outport_byte( _port, _value ) \
    303 do { register unsigned short __port  = _port; \
    304      register unsigned char  __value = _value; \
     303do { unsigned short __port  = _port; \
     304     unsigned char  __value = _value; \
    305305     \
    306306     __asm__ volatile ( "outb %0,%1" : : "a" (__value), "d" (__port) ); \
     
    308308
    309309#define i386_outport_word( _port, _value ) \
    310 do { register unsigned short __port  = _port; \
    311      register unsigned short __value = _value; \
     310do { unsigned short __port  = _port; \
     311     unsigned short __value = _value; \
    312312     \
    313313     __asm__ volatile ( "outw %0,%1" : : "a" (__value), "d" (__port) ); \
     
    315315
    316316#define i386_outport_long( _port, _value ) \
    317 do { register unsigned short __port  = _port; \
    318      register unsigned int  __value = _value; \
     317do { unsigned short __port  = _port; \
     318     unsigned int  __value = _value; \
    319319     \
    320320     __asm__ volatile ( "outl %0,%1" : : "a" (__value), "d" (__port) ); \
     
    322322
    323323#define i386_inport_byte( _port, _value ) \
    324 do { register unsigned short __port  = _port; \
    325      register unsigned char  __value = 0; \
     324do { unsigned short __port  = _port; \
     325     unsigned char  __value = 0; \
    326326     \
    327327     __asm__ volatile ( "inb %1,%0" : "=a" (__value) \
     
    332332
    333333#define i386_inport_word( _port, _value ) \
    334 do { register unsigned short __port  = _port; \
    335      register unsigned short __value = 0; \
     334do { unsigned short __port  = _port; \
     335     unsigned short __value = 0; \
    336336     \
    337337     __asm__ volatile ( "inw %1,%0" : "=a" (__value) \
     
    342342
    343343#define i386_inport_long( _port, _value ) \
    344 do { register unsigned short __port  = _port; \
    345      register unsigned int  __value = 0; \
     344do { unsigned short __port  = _port; \
     345     unsigned int  __value = 0; \
    346346     \
    347347     __asm__ volatile ( "inl %1,%0" : "=a" (__value) \
  • cpukit/score/cpu/i386/include/rtems/score/interrupts.h

    r696b9121 rf35c3be9  
    6363#define i386_get_interrupt_level( _level ) \
    6464  do { \
    65     register uint32_t   _eflags; \
     65    uint32_t   _eflags; \
    6666    \
    6767    __asm__ volatile ( "pushf ; \
  • cpukit/score/cpu/lm32/include/rtems/score/lm32.h

    r696b9121 rf35c3be9  
    7474
    7575#define lm32_disable_interrupts( _level ) \
    76   do { register uint32_t ie; \
     76  do { uint32_t ie; \
    7777    __asm__ volatile ("rcsr %0,ie":"=r"(ie)); \
    7878    (_level) = ie; \
     
    8585
    8686#define lm32_flash_interrupts( _level ) \
    87   do { register uint32_t ie; \
     87  do { uint32_t ie; \
    8888    __asm__ volatile ("wcsr ie,%0"::"r"(_level)); \
    8989    ie = (_level) & (~0x0001); \
     
    9292
    9393#define lm32_interrupt_unmask( _mask ) \
    94   do { register uint32_t im; \
     94  do { uint32_t im; \
    9595    __asm__ volatile ("rcsr %0,im":"=r"(im)); \
    9696    im |= _mask; \
     
    9999
    100100#define lm32_interrupt_mask( _mask ) \
    101   do { register uint32_t im; \
     101  do { uint32_t im; \
    102102    __asm__ volatile ("rcsr %0,im":"=r"(im)); \
    103103    im &= ~(_mask); \
     
    106106
    107107#define lm32_interrupt_ack( _mask ) \
    108   do { register uint32_t ip = _mask; \
     108  do { uint32_t ip = _mask; \
    109109    __asm__ volatile ("wcsr ip,%0"::"r"(ip)); \
    110110  } while (0)
  • cpukit/score/cpu/m68k/include/rtems/score/cpu.h

    r696b9121 rf35c3be9  
    502502#define _CPU_Bitfield_Find_first_bit( _value, _output ) \
    503503  { \
    504     register int dumby; \
     504    int dumby; \
    505505    \
    506506    __asm__ volatile ( \
     
    522522#define _CPU_Bitfield_Find_first_bit( _value, _output ) \
    523523  { \
    524     register int dumby; \
     524    int dumby; \
    525525    \
    526526    __asm__ volatile ( "   move.w  %2,%1\n"        \
     
    540540#define _CPU_Bitfield_Find_first_bit( _value, _output ) \
    541541  { \
    542     register int dumby; \
     542    int dumby; \
    543543    \
    544544    __asm__ volatile ( "   move.w  %2,%1\n"        \
  • cpukit/score/cpu/m68k/include/rtems/score/m68k.h

    r696b9121 rf35c3be9  
    335335#if ( defined(__mcoldfire__) )
    336336#define m68k_disable_interrupts( _level ) \
    337    do { register uint32_t   _tmpsr = 0x0700; \
     337   do { uint32_t   _tmpsr = 0x0700; \
    338338        __asm__ volatile ( "move.w %%sr,%0\n\t" \
    339339                       "or.l   %0,%1\n\t" \
     
    355355#if ( defined(__mcoldfire__) )
    356356#define m68k_flash_interrupts( _level ) \
    357    do { register uint32_t   _tmpsr = 0x0700; \
     357   do { uint32_t   _tmpsr = 0x0700; \
    358358        asm volatile ( "move.w %2,%%sr\n\t" \
    359359                       "or.l   %2,%1\n\t" \
     
    372372#define m68k_get_interrupt_level( _level ) \
    373373  do { \
    374     register uint32_t   _tmpsr; \
     374    uint32_t   _tmpsr; \
    375375    \
    376376    __asm__ volatile( "move.w %%sr,%0" : "=d" (_tmpsr)); \
     
    380380#define m68k_set_interrupt_level( _newlevel ) \
    381381  do { \
    382     register uint32_t   _tmpsr; \
     382    uint32_t   _tmpsr; \
    383383    \
    384384    __asm__ volatile( "move.w  %%sr,%0" : "=d" (_tmpsr)); \
  • cpukit/score/cpu/mips/include/rtems/score/mips.h

    r696b9121 rf35c3be9  
    137137#define mips_set_sr( _x ) \
    138138  do { \
    139     register unsigned int __x = (_x); \
     139    unsigned int __x = (_x); \
    140140    __asm__ volatile( "mtc0 %0, $12; nop" : : "r" (__x) ); \
    141141  } while (0)
     
    154154#define mips_set_cause( _x ) \
    155155  do { \
    156     register unsigned int __x = (_x); \
     156    unsigned int __x = (_x); \
    157157    __asm__ volatile( "mtc0 %0, $13; nop" : : "r" (__x) ); \
    158158  } while (0)
     
    173173#define mips_set_dcic( _x ) \
    174174  do { \
    175     register unsigned int __x = (_x); \
     175    unsigned int __x = (_x); \
    176176    __asm__ volatile( "mtc0 %0, $7; nop" : : "r" (__x) ); \
    177177  } while (0)
     
    194194#define mips_set_bpcrm( _x, _y ) \
    195195  do { \
    196     register unsigned int __x = (_x); \
    197     register unsigned int __y = (_y); \
     196    unsigned int __x = (_x); \
     197    unsigned int __y = (_y); \
    198198    __asm__ volatile( "mtc0 %0, $11; nop" : : "r" (__y) ); \
    199199    __asm__ volatile( "mtc0 %0, $3; nop" : : "r" (__x) ); \
     
    219219#define mips_set_bdarm( _x, _y ) \
    220220  do { \
    221     register unsigned int __x = (_x); \
    222     register unsigned int __y = (_y); \
     221    unsigned int __x = (_x); \
     222    unsigned int __y = (_y); \
    223223    __asm__ volatile( "mtc0 %0, $9; nop" : : "r" (__y) ); \
    224224    __asm__ volatile( "mtc0 %0, $5; nop" : : "r" (__x) ); \
     
    245245#define mips_set_fcr31( _x ) \
    246246  do { \
    247     register unsigned int __x = (_x); \
     247    unsigned int __x = (_x); \
    248248    __asm__ volatile( "ctc1 %0, $31; nop" : : "r" (__x) ); \
    249249  } while(0)
  • cpukit/score/cpu/powerpc/include/rtems/score/cpu.h

    r696b9121 rf35c3be9  
    662662static inline uint32_t   _CPU_ISR_Get_level( void )
    663663{
    664   register unsigned int msr;
     664  uint32_t msr;
    665665  _CPU_MSR_GET(msr);
    666666  if (msr & MSR_EE) return 0;
     
    670670static inline void _CPU_ISR_Set_level( uint32_t   level )
    671671{
    672   register unsigned int msr;
     672  uint32_t msr;
    673673  _CPU_MSR_GET(msr);
    674674  if (!(level & CPU_MODES_INTERRUPT_MASK)) {
  • cpukit/score/cpu/riscv/include/rtems/score/cpu.h

    r696b9121 rf35c3be9  
    159159static inline unsigned long riscv_interrupt_disable( void )
    160160{
    161   register unsigned long status = read_csr(mstatus);
     161  unsigned long status = read_csr(mstatus);
    162162  clear_csr(mstatus, MSTATUS_MIE);
    163163  return status;
  • cpukit/score/cpu/sh/include/rtems/score/sh.h

    r696b9121 rf35c3be9  
    171171#define sh_get_interrupt_level( _level ) \
    172172{ \
    173   register uint32_t   _tmpsr ; \
     173  uint32_t   _tmpsr ; \
    174174  \
    175175  __asm__ volatile( "stc sr, %0" : "=r" (_tmpsr) ); \
     
    179179#define sh_set_interrupt_level( _newlevel ) \
    180180{ \
    181   register uint32_t   _tmpsr; \
     181  uint32_t   _tmpsr; \
    182182  \
    183183  __asm__ volatile ( "stc sr, %0" : "=r" (_tmpsr) ); \
     
    195195)
    196196{
    197   register uint32_t swapped;
     197  uint32_t swapped;
    198198
    199199  __asm__ volatile (
     
    211211)
    212212{
    213   register uint16_t swapped ;
     213  uint16_t swapped ;
    214214
    215215  __asm__ volatile ( "swap.b %1,%0" : "=r" (swapped) : "r"  (value) );
  • cpukit/score/cpu/sparc/include/rtems/score/sparc.h

    r696b9121 rf35c3be9  
    391391#define sparc_get_interrupt_level( _level ) \
    392392  do { \
    393     register uint32_t  _psr_level = 0; \
     393    uint32_t _psr_level = 0; \
    394394    \
    395395    sparc_get_psr( _psr_level ); \
Note: See TracChangeset for help on using the changeset viewer.