[MDEV-31890] Compilation failing on MacOS (unknown warning option -Wno-unused-but-set-variable) Created: 2023-08-10  Updated: 2023-10-11  Resolved: 2023-08-28

Status: Closed
Project: MariaDB Server
Component/s: Compiling
Affects Version/s: 10.4, 10.5, 10.6, 10.7, 10.8, 10.9, 10.10, 10.11, 11.0, 11.1, 11.2
Fix Version/s: 10.4.32, 10.5.23, 10.6.16, 10.10.7, 10.11.6, 11.0.4, 11.1.3, 11.2.2, 11.3.0

Type: Bug Priority: Major
Reporter: Dmitry Shulga Assignee: Dmitry Shulga
Resolution: Fixed Votes: 0
Labels: None


 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.



 Comments   
Comment by Dmitry Shulga [ 2023-08-11 ]

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

Comment by Oleksandr Byelkin [ 2023-08-25 ]

OK to push

Comment by Marko Mäkelä [ 2023-10-11 ]

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.

Generated at Thu Feb 08 10:27:14 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.