When compiling with Clang, the following error occurs:
[2/3] Compiling C++ object test_fd-receive-read.p/tests_fd-receive-read.cpp.o FAILED: [code=1] test_fd-receive-read.p/tests_fd-receive-read.cpp.o clang++ -Itest_fd-receive-read.p -I. -I.. -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/lib64/libffi/include -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/gio-unix-2.0 -fdiagnostics-color=always -D_GLIBCXX_ASSERTIONS=1 -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Werror -std=c++17 -O0 -g -DGDBUSPP_DEBUG -pthread -MD -MQ test_fd-receive-read.p/tests_fd-receive-read.cpp.o -MF test_fd-receive-read.p/tests_fd-receive-read.cpp.o.d -o test_fd-receive-read.p/tests_fd-receive-read.cpp.o -c ../tests/fd-receive-read.cpp ../tests/fd-receive-read.cpp:145:18: error: variable length arrays in C++ are a Clang extension [-Werror,-Wvla-cxx-extension] 145 | char buf[opts.bufsize + 1]; | ^~~~~~~~~~~~~~~~ ../tests/fd-receive-read.cpp:145:18: note: read of non-constexpr variable 'opts' is not allowed in a constant expression ../tests/fd-receive-read.cpp:120:17: note: declared here 120 | Options opts(argc, argv); | ^ 1 error generated.
I managed to temporarily suppress the error by setting -Werror to false on meson.build but this isn't a permanent solution. Build compiles normally under GCC.
When compiling with Clang, the following error occurs:
`[2/3] Compiling C++ object test_fd-receive-read.p/tests_fd-receive-read.cpp.o
FAILED: [code=1] test_fd-receive-read.p/tests_fd-receive-read.cpp.o
clang++ -Itest_fd-receive-read.p -I. -I.. -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/lib64/libffi/include -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/gio-unix-2.0 -fdiagnostics-color=always -D_GLIBCXX_ASSERTIONS=1 -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Werror -std=c++17 -O0 -g -DGDBUSPP_DEBUG -pthread -MD -MQ test_fd-receive-read.p/tests_fd-receive-read.cpp.o -MF test_fd-receive-read.p/tests_fd-receive-read.cpp.o.d -o test_fd-receive-read.p/tests_fd-receive-read.cpp.o -c ../tests/fd-receive-read.cpp
../tests/fd-receive-read.cpp:145:18: error: variable length arrays in C++ are a Clang extension [-Werror,-Wvla-cxx-extension]
145 | char buf[opts.bufsize + 1];
| ^~~~~~~~~~~~~~~~
../tests/fd-receive-read.cpp:145:18: note: read of non-constexpr variable 'opts' is not allowed in a constant expression
../tests/fd-receive-read.cpp:120:17: note: declared here
120 | Options opts(argc, argv);
| ^
1 error generated.`
I managed to temporarily suppress the error by setting -Werror to false on meson.build but this isn't a permanent solution. Build compiles normally under GCC.