fails to build on musl libc by default
[61/70] Compiling C object src/libei.so.1.0.0.p/meson-generated_.._ei-proto.c.o
ninja: job failed: gcc -Isrc/libei.so.1.0.0.p -Isrc -I../src -I. -I.. -fvisibility=hidden -flto=auto -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -std=gnu99 -Wno-unused-parameter -Wmissing-prototypes -Wno-missing-field-initializers -Wstrict-prototypes -Wstrict-prototypes -Wlogical-op -Wpointer-arith -Wuninitialized -Winit-self -Wstrict-prototypes -Wimplicit-fallthrough -Wredundant-decls -Wincompatible-pointer-types -Wformat=2 -Wformat-overflow=2 -Wformat-signedness -Wformat-truncation=2 -Wmissing-declarations -Wshift-overflow=2 -Wstrict-overflow=2 -Wswitch -Os -fstack-clash-protection -Wformat -Werror=format-security -fno-plt -fPIC -MD -MQ src/libei.so.1.0.0.p/brei-shared.c.o -MF src/libei.so.1.0.0.p/brei-shared.c.o.d -o src/libei.so.1.0.0.p/brei-shared.c.o -c ../src/brei-shared.c
../src/brei-shared.c:50:15: error: expected declaration specifiers or '...' before 'sizeof'
50 | static_assert(sizeof(struct brei_header) == 16, "Unexpected size for brei_header struct");
| ^~~~~~
../src/brei-shared.c:50:49: error: expected declaration specifiers or '...' before string constant
50 | static_assert(sizeof(struct brei_header) == 16, "Unexpected size for brei_header struct");
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/brei-shared.c:56:15: error: expected declaration specifiers or '...' before 'sizeof'
56 | static_assert(sizeof(struct brei_string) == 4, "Unexpected size for brei_string struct");
| ^~~~~~
../src/brei-shared.c:56:48: error: expected declaration specifiers or '...' before string constant
56 | static_assert(sizeof(struct brei_string) == 4, "Unexpected size for brei_string struct");
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
this seems to be because the language level is gnu99
, but the static_assert is actually c11 (i'm not sure if it's technically legal for gnu99?)
so, the following fixes it:
--- a/meson.build
+++ b/meson.build
@@ -1,7 +1,7 @@
project('libei', 'c',
version: '1.0.0',
license: 'MIT',
- default_options: [ 'c_std=gnu99', 'warning_level=2' ],
+ default_options: [ 'c_std=gnu11', 'warning_level=2' ],
meson_version: '>= 0.56.0')
libei_version = meson.project_version().split('.')
but of course that raises the level