Disable check for override in gcc

2019-07-11 05:32发布

问题:

Is there a way to enforce gcc to ignore errors which result from C++11's override?

Explanation: I want to enable C++11 in a program. Unfortunately it misused some functions and macros from a library causing many marked override, but does not override errors. So I want to disable the error, just to check if there are more issues and then replace the errors step by step.

I checked the -W options, but they handle warings only. This is a real error.

回答1:

As a hack you can use -Doverride= on the command line. This will make it so GCC does not see override.