3
1
Fork
You've already forked gdbuspp
1

Build fails to compile on Clang #4

Open
opened 2025年12月05日 14:36:06 +01:00 by lidistat67 · 2 comments

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.
No description provided.
Owner
Copy link

I just quickly pushed out commit 2db322af3b which should resolve this issue.

I just quickly pushed out commit 2db322af3bf2529d035a3cf25eab145c56d209c4 which should resolve this issue.
Sign in to join this conversation.
No Branch/Tag specified
master
v3
v2
v1
Labels
Clear labels
Development done
The issue should have been resolved, just waiting for a release to happen
distro-support
OS distribution support
Awaiting external feedback
Feedback from an external party is needed to continue investigation
Bug
Something is not working
build
Issue is related to the build system (meson) or general compilation issues
contribution welcome
Contributions are very welcome, get started here
duplicate
This issue or pull request already exists
Enhancement
Proposal for an enhancement or new feature
Infrastructure
Issue related to the infrastructure for builds, package repositories, etc
invalid
The issue is not applicable to this project
Investigating
The issue is being investigated by a project developer
Rejected
This issue will not be resolved. It might be re-opened if a new situation requires it, but it has no priority currently
Support
Issue is a support question, not a bug
tests programs
Issue is related to code in gdbuspp/tests
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
OpenVPN/gdbuspp#4
Reference in a new issue
OpenVPN/gdbuspp
No description provided.
Delete branch "%!s()"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?