Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-33746

macOS virtual override markings missing

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

          Activity

            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.

            marko Marko Mäkelä added a comment - 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 .
            Gosselin Dave Gosselin added a comment - https://github.com/MariaDB/server/pull/3331
            Gosselin Dave Gosselin added a comment -

            Removed redundant virtual keywords

            Gosselin Dave Gosselin added a comment - Removed redundant virtual keywords
            Gosselin Dave Gosselin added a comment -

            This work completed as a "light week" task between sprints.

            Gosselin Dave Gosselin added a comment - This work completed as a "light week" task between sprints.

            People

              Gosselin Dave Gosselin
              Gosselin Dave Gosselin
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.