project-repo/cagebreak

2.4.0 fails to build with Clang < 18 and GCC < 14

Opened this issue · 3 comments

cagebreak still builds fine with -std=c11 and (unlike wlroots where -std=c23 is autodetected) doesn't use __VA_OPT__. Why intentionally break then?

$ cc --version
FreeBSD clang version 17.0.6 (https://github.com/llvm/llvm-project.git llvmorg-17.0.6-0-g6009708b4367)
Target: x86_64-unknown-freebsd13.3
Thread model: posix
InstalledDir: /usr/bin

$ meson setup _build
The Meson build system
Version: 1.6.0.rc1
Source dir: .../cagebreak-2.4.0
Build dir: .../cagebreak-2.4.0/_build
Build type: native build
meson_options.txt:3: WARNING: Project does not target a minimum version but uses feature deprecated since '1.1.0': "boolean option" keyword argument "value" of type str. use a boolean, not a string
meson_options.txt:4: WARNING: Project does not target a minimum version but uses feature deprecated since '1.1.0': "boolean option" keyword argument "value" of type str. use a boolean, not a string
meson_options.txt:5: WARNING: Project does not target a minimum version but uses feature deprecated since '1.1.0': "boolean option" keyword argument "value" of type str. use a boolean, not a string
Project name: cagebreak
Project version: 2.4.0

meson.build:3:0: ERROR: None of values ['c23'] are supported by the C compiler. Possible values for option "C_std" are ['none', 'c89', 'c99', 'c11', 'c17', 'c18', 'c2x', 'gnu89', 'gnu99', 'gnu11', 'gnu17', 'gnu18', 'gnu2x']

A full log can be found at .../cagebreak-2.4.0/_build/meson-logs/meson-log.txt

Hi jbeich,
Sorry for this. The issue is that the code is strictly speaking not
std<23 compatible. (ISO C99 requires at least one argument for the "..."
in a variadic macro). The only possibility we saw for fixing this was to
require at least std=3Dc23. So we had the tension between having a
release build with no warnings basically for free vs a big cost of
conforming to new warnings for an older version of C - though it did
break stuff, even for us (fuzzing) it seemed like the best option.

We are very open to ideas that address the issue.

Cheers
project-repo

ISO C99 requires at least one argument for the "..." in a variadic macro

Clang doesn't print this warning in -std=c11 mode. See downstream build log after applying workaround.

Thank you very much for your swift reply, we will include the patch for meson.build in our next release, which will hopefully occur sooner than last time.

cheers
project-repo