Notice: We have migrated to GitLab launching 2024-05-01 see here: https://gitlab.rtems.org/

#3397 closed defect (fixed)

The register keyword is deprecated in C++11

Reported by: Sebastian Huber Owned by: Sebastian Huber
Priority: normal Milestone: 5.1
Component: unspecified Version: 5
Severity: normal Keywords:
Cc: Blocked By:
Blocking:

Description

The following code gives a warning with GCC and -std=c++17:

void f(void)
{
  register int i;
}
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;
               ^

Remove the use of the register keyword at least in the public header files for C++ compatibility.

Change History (1)

comment:1 Changed on 04/17/18 at 05:06:01 by Sebastian Huber <sebastian.huber@…>

Resolution: fixed
Status: assignedclosed

In [changeset:"f35c3be9f8968daaa1b3e81808f9b99079d17a68/rtems" f35c3be9/rtems]:

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.

Note: See TracTickets for help on using tickets.