Ancient `register' keyword is gone with C++17, drop it from various
places. Also, ISO C99 and later no longer tolerate implicit function
declarations, but the code in question is too convoluted and fragile
to fix properly, so just disable the warning for the time being.
While here, do not hardcode -O2 for release builds (system-provided
compilation flags being correctly upheld) and spell -Wextra correctly
(quoting the GCC docs*, this option used to be called -W; the older
name is still supported, but the newer name is more descriptive).
Reported by: pkg-fallout
*) https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wextra