FreeBSD clang -std99 -pedantic doesn't like static_assert #3693
Labels
bug
component-platform
Portability layer and build scripts
historical-reviewing
Currently reviewing (for legacy PR/issues)
On FreeBSD 11.2 with Clang 6.0.0, or on FreeBSD 11.1-RC2 with Clang 4.0.0, Mbed TLS does not build with
clang -std=c99 -pedantic -Werror
. Observed with mbed TLS 2.24.0, and a few versions before.The offending code looks like this:
so it's valid C99 code (which skips the asserts)
This can be reproduced with
tests/scripts/all.sh -k test_clang_opt
which we want to run on FreeBSD on our CI.I cannot reproduce this on Linux, neither on https://godbolt.org/ nor on my machine (I tried several versions of Clang including 6.0.0). So it seems to be a FreeBSD thing.
I'm labelling this as “bug” because we do try to build without warnings on popular platforms, although it's borderline because the problem only occurs with a pedantic flag, not with a basic
-std=c99 -Werror -Wall -Wextra
. Mostly it's a bug because it fires on our CI and it's inconvenient to work around in a CI script.The text was updated successfully, but these errors were encountered: