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

Compilation failing on MacOS (unknown warning option -Wno-unused-but-set-variable)

Details

    Description

      Compiling fails with XCode 13.2.1 (Apple clang version 13.0.0)
      In case XCode is upgraded to the version 13.3.1 (Apple clangvversion 13.1.6) compiling be finished successfully.

      Attachments

        Activity

          shulga Dmitry Shulga added a comment -

          The patch for review is pushed to the branch bb-10.4-MDEV-31890

          shulga Dmitry Shulga added a comment - The patch for review is pushed to the branch bb-10.4- MDEV-31890

          OK to push

          sanja Oleksandr Byelkin added a comment - OK to push
          marko Marko Mäkelä added a comment - - edited

          I think that it is better to avoid adding any configuration-time checks or target-specific COMPILE_FLAGS. The cmake configuration step is already taking way too long, and it is executed in a single thread. On my system, the configuration step takes roughly as much time as the rest of the compilation!

          I tested the following in various compilers on https://godbolt.org, and I believe that Apple proprietary fork of clang should be fine with it as well.

          #ifdef __GNUC__
          # pragma GCC diagnostic ignored "-Wpragmas" /* silence GCC about the following */
          # pragma GCC diagnostic ignored "-Wunknown-warning-option" /* silence clang */
          # pragma GCC diagnostic ignored "-Wunused-but-set-variable"
          #endif
          

          The only relevant compiler that would issue warnings for the above would be icc older than 16.0, but I do not think that we should care about very old versions of nonstandard compilers. The oldest clang that does not issue any warnings about the above is version 3.5.

          marko Marko Mäkelä added a comment - - edited I think that it is better to avoid adding any configuration-time checks or target-specific COMPILE_FLAGS . The cmake configuration step is already taking way too long, and it is executed in a single thread. On my system, the configuration step takes roughly as much time as the rest of the compilation! I tested the following in various compilers on https://godbolt.org , and I believe that Apple proprietary fork of clang should be fine with it as well. #ifdef __GNUC__ # pragma GCC diagnostic ignored "-Wpragmas" /* silence GCC about the following */ # pragma GCC diagnostic ignored "-Wunknown-warning-option" /* silence clang */ # pragma GCC diagnostic ignored "-Wunused-but-set-variable" #endif The only relevant compiler that would issue warnings for the above would be icc older than 16.0, but I do not think that we should care about very old versions of nonstandard compilers. The oldest clang that does not issue any warnings about the above is version 3.5.

          People

            shulga Dmitry Shulga
            shulga Dmitry Shulga
            Votes:
            0 Vote for this issue
            Watchers:
            3 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.