Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build (cmake): LIBZMQ_WERROR is broken #4700

Open
fanquake opened this issue Jul 8, 2024 · 0 comments
Open

build (cmake): LIBZMQ_WERROR is broken #4700

fanquake opened this issue Jul 8, 2024 · 0 comments

Comments

@fanquake
Copy link
Contributor

fanquake commented Jul 8, 2024

Issue description

Usage of LIBZMQ_WERROR is mostly broken, because the build system is throwing other warnings when usage of the flag is being tested. i.e when building using GCC 14.1.1:

/usr/lib64/ccache/c++   -std=c++11 -Wno-tautological-constant-compare    -DHAVE_FLAG_-Werror -Werror -o CMakeFiles/cmTC_bc312.dir/src.cxx.o -c /root/libzmq/build/CMakeFiles/CMakeScratch/TryCompile-QS6bbk/src.cxx
<command-line>: error: ISO C++11 requires whitespace after the macro name [-Werror]
cc1plus: note: unrecognized command-line option '-Wno-tautological-constant-compare' may have been intended to silence earlier diagnostics
cc1plus: all warnings being treated as errors

The same happens under Clang 18.1.7:

/usr/lib64/ccache/clang++   -std=c++11 -Wno-tautological-constant-compare -Wall -Wextra -Wno-long-long -Wno-uninitialized -pedantic    -DHAVE_FLAG_-Werror -Werror -MD -MT CMakeFiles/cmTC_90abf.dir/src.cxx.o -MF CMakeFiles/cmTC_90abf.dir/src.cxx.o.d -o CMakeFiles/cmTC_90abf.dir/src.cxx.o -c /root/libzmq/build/CMakeFiles/CMakeScratch/TryCompile-N1gFrx/src.cxx
        In file included from <built-in>:430:
<command line>:1:19: error: ISO C99 requires whitespace after the macro name [-Werror,-Wc99-extensions]
            1 | #define HAVE_FLAG_-Werror 1
              |                   ^
1 error generated.

The -Werror test converts this warning (ISO C++11 requires whitespace after the macro name) into an error, and -Werror is never added as a build flag. Note that this likely effects a number of other options/checks as well.

Environment

  • libzmq version (commit hash if unreleased): c2fae81
  • OS: Fedora

Minimal test code / Steps to reproduce the issue

  1. cmake -B build

What's the actual result? (include assertion message & call stack if applicable)

-- Performing Test HAVE_FLAG_-Werror
-- Performing Test HAVE_FLAG_-Werror - Failed

What's the expected result?

-- Performing Test HAVE_FLAG_-Werror
-- Performing Test HAVE_FLAG_-Werror - Success
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant