https://gcc.gnu.org/bugzilla/show_bug.cgi?id=7651

--- Comment #39 from Heiko Eißfeldt <heiko at hexco dot de> ---
For handling this warning from cp/typeck.cc line 4316
```cpp
            warning_at (loc, OPT_Wextra,
                        "subscripting array declared %<register%>");
```

triggered for example by
```
int main(void)
{
    register int e[] = { 3,2,1 };
    int f = 1;
    return e[f];
}
```

I noticed there is already -Wregister:
```
-Wregister (C++ and Objective-C++ only)
Warn on uses of the register storage class specifier, except when it is part of
the GNU Section 6.11.6 [Explicit Register Variables], page 774, extension. The
use of the register keyword as storage class specifier has been deprecated in
C++11 and removed in C++17. Enabled by default with -std=c++17.
```

Would it be reasonable to include the above warning in -Wregister or would a
separate new warning option be preferred?
Thanks!

Reply via email to