Details
Description
clang on macOS complains about the lack of override markings for virtual override methods, one such example (of many):
/Users/dgosselin/10.5/server/sql/../storage/myisam/ha_myisam.h:163:7: warning: 'multi_range_read_next' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
|
int multi_range_read_next(range_id_t *range_info);
|
Attachments
Issue Links
- relates to
-
MDEV-34185 macOS Build & Test
-
- Open
-
In plain clang, if you add -Wsuggest-override to CMAKE_CXX_FLAGS, it will catch these. I tested with clang-16:
10.5 a13e521bc51d3ad9bb6e8e6481a0c8dea3b648a7
/mariadb/10.5/plugin/handler_socket/libhsclient/hstcpcli.cpp:30:16: error: 'close' overrides a member function but is not marked 'override' [-Werror,-Wsuggest-override]
virtual void close();
^
/mariadb/10.5/plugin/handler_socket/libhsclient/hstcpcli.hpp:37:16: note: overridden virtual function is here
virtual void close() = 0;
^
I think that once this has been fixed, we should add -Wsuggest-override to the flags, so that the mandatory MemorySanitizer builder will prevent these errors.
The -Winconsistent-missing-override is already enabled by default, but it is sloppier in the plain clang.