Compiler option `-Werror=suggest-override` causes problems with `FlexLexer.h`
In private e-mails, Hans Åborg reports compilation problems with recent clang compilers on MacOS using MacPorts. The error message is
/opt/local/include/FlexLexer.h:132:8: error: \
'yy_switch_to_buffer' overrides a member function \
but is not marked 'override' [-Werror,-Wsuggest-override]
/opt/local/include/FlexLexer.h:67:3: note: \
overridden virtual function is here \
yy_switch_to_buffer( yy_buffer_state* new_buffer ) = 0;
It is not clear why this suddenly causes compilation problems. Irrespective of that, and while it is possible to work around the problem with command line arguments for the MacPorts build, it is better IMHO to fix this in LilyPond: Activate the warning only in debugging builds, that is, if --disable-optimising
is active. Note that the override
specifier is optional in C++; it thus doesn't help in any way for non-development builds.
Dan, please have a look.