cxx: remove a compilation warning for g++ 7.x
Remove a compilation warning about an unsupported warning category for g++ 7.x.
A #pragma directive was used to suppress a -Wcast-function-type warning
Versions older than 8.x do not have this warning category and raises a warning
because of this directive.
Now this directive is only enabled for g++ version 8.x or newer.