Fails to build with GCC 11
When building with gcc 11.1.0 I get this error:
cc -Ilibrist.so.4.0.0.p -I. -I../librist-v0.2.0 -I../librist-v0.2.0/src -Iinclude/librist -I../librist-v0.2.0/include/librist -Iinclude -I../librist-v0.2.0/include -Icontrib -I../librist-v0.2.0/contrib -I/usr/include -flto=auto -fdiagnostics-color=always -Wall -Winvalid-pch -Wextra -Wpedantic -std=c99 -D_GNU_SOURCE -DLINUX_CRYPTO -Wshadow -pedantic-errors -Wundef -Wno-maybe-uninitialized -Wno-missing-field-initializers -Wno-unused-parameter -Wunused-parameter -Wmaybe-uninitialized -Wno-error=deprecated-declarations -fvisibility=hidden -DUSE_MBEDTLS -D_FILE_OFFSET_BITS=64 -march=haswell -O2 -pipe -fno-plt -D_FORTIFY_SOURCE=2 -fPIC -pthread -MD -MQ librist.so.4.0.0.p/src_logging.c.o -MF librist.so.4.0.0.p/src_logging.c.o.d -o librist.so.4.0.0.p/src_logging.c.o -c ../librist-v0.2.0/src/logging.c
In file included from ../librist-v0.2.0/src/log-private.h:11,
from ../librist-v0.2.0/src/logging.c:9:
../librist-v0.2.0/src/logging.c: In function ‘rist_log_impl’:
../librist-v0.2.0/include/common/attributes.h:50:26: error: a label can only be part of a statement and a declaration is not a statement [-Wpedantic]
50 | #define RIST_FALLTHROUGH __attribute__ ((fallthrough))
| ^~~~~~~~~~~~~
../librist-v0.2.0/src/logging.c:85:17: note: in expansion of macro ‘RIST_FALLTHROUGH’
85 | RIST_FALLTHROUGH;
| ^~~~~~~~~~~~~~~~
ninja: build stopped: subcommand failed.
It builds fine with gcc 10.2.0 and clang 11.1.0. I do not have clang 12 to test.
Using librist 0.2.0 sources.
System Information:
- OS: Arch Linux x86_64
- meson: 0.58.0
- ninja: 1.10.2