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

            Gosselin Dave Gosselin created issue -
            Gosselin Dave Gosselin made changes -
            Field Original Value New Value

            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 .
            serg Sergei Golubchik made changes -
            Assignee Dave Gosselin [ JIRAUSER52216 ]
            serg Sergei Golubchik made changes -
            Issue Type Task [ 3 ] Bug [ 1 ]
            serg Sergei Golubchik made changes -
            Fix Version/s 10.5 [ 23123 ]
            Fix Version/s 10.6 [ 24028 ]
            serg Sergei Golubchik made changes -
            Affects Version/s 10.5 [ 23123 ]
            nikitamalyavin Nikita Malyavin made changes -
            Comment [ My clang also complains, I just build with {{-Wno-inconsistent-missing-override}} ]
            Gosselin Dave Gosselin made changes -
            Status Open [ 1 ] In Progress [ 3 ]
            Gosselin Dave Gosselin made changes -
            Assignee Dave Gosselin [ JIRAUSER52216 ] Marko Mäkelä [ marko ]
            Status In Progress [ 3 ] In Review [ 10002 ]
            Gosselin Dave Gosselin added a comment - https://github.com/MariaDB/server/pull/3331
            marko Marko Mäkelä made changes -
            Assignee Marko Mäkelä [ marko ] Dave Gosselin [ JIRAUSER52216 ]
            Status In Review [ 10002 ] Stalled [ 10000 ]
            Gosselin Dave Gosselin added a comment -

            Removed redundant virtual keywords

            Gosselin Dave Gosselin added a comment - Removed redundant virtual keywords
            Gosselin Dave Gosselin made changes -
            Assignee Dave Gosselin [ JIRAUSER52216 ] Marko Mäkelä [ marko ]
            Status Stalled [ 10000 ] In Review [ 10002 ]
            Gosselin Dave Gosselin made changes -
            Assignee Marko Mäkelä [ marko ] Dave Gosselin [ JIRAUSER52216 ]
            Gosselin Dave Gosselin made changes -
            Status In Review [ 10002 ] Stalled [ 10000 ]
            Gosselin Dave Gosselin made changes -
            Status Stalled [ 10000 ] In Progress [ 3 ]
            Gosselin Dave Gosselin made changes -
            Assignee Dave Gosselin [ JIRAUSER52216 ] Marko Mäkelä [ marko ]
            Status In Progress [ 3 ] In Review [ 10002 ]
            marko Marko Mäkelä made changes -
            Assignee Marko Mäkelä [ marko ] Dave Gosselin [ JIRAUSER52216 ]
            Status In Review [ 10002 ] Stalled [ 10000 ]
            Gosselin Dave Gosselin made changes -
            Status Stalled [ 10000 ] In Progress [ 3 ]
            Gosselin Dave Gosselin made changes -
            Component/s Compiling [ 11001 ]
            Fix Version/s 10.5.26 [ 29832 ]
            Fix Version/s 10.5 [ 23123 ]
            Fix Version/s 10.6 [ 24028 ]
            Resolution Fixed [ 1 ]
            Status In Progress [ 3 ] Closed [ 6 ]
            JIraAutomate JiraAutomate made changes -
            Fix Version/s 10.6.19 [ 29833 ]
            Fix Version/s 10.11.9 [ 29834 ]
            Fix Version/s 11.1.6 [ 29835 ]
            Fix Version/s 11.2.5 [ 29836 ]
            Fix Version/s 11.4.3 [ 29837 ]
            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.