Clang 18 has a new warning about variable length arrays used in C++, which is emitted when building devel/bossa: src/Flasher.cpp:115:28: error: variable length arrays in C++ are a Clang extension [-Werror,-Wvla-cxx-extension] 115 | uint8_t buffer[bufferSize]; | ^~~~~~~~~~ src/Flasher.cpp:115:28: note: read of non-const variable 'bufferSize' is not allowed in a constant expression src/Flasher.cpp:114:22: note: declared here 114 | uint32_t bufferSize = _samba.writeBufferSize(); | ^ [... more of these ...] Since refactoring the code to no longer use VLAs is rather intrusive, suppress the warnings instead.
Created attachment 248159 [details] devel/bossa: fix build with clang 18
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=30a231f8eb872f67eac8514ba96da91cc4b9f44f commit 30a231f8eb872f67eac8514ba96da91cc4b9f44f Author: Dimitry Andric <dim@FreeBSD.org> AuthorDate: 2024-02-03 13:21:20 +0000 Commit: Dimitry Andric <dim@FreeBSD.org> CommitDate: 2024-02-24 11:01:04 +0000 devel/bossa: fix build with clang 18 Clang 18 has a new warning about variable length arrays used in C++, which is emitted when building devel/bossa: src/Flasher.cpp:115:28: error: variable length arrays in C++ are a Clang extension [-Werror,-Wvla-cxx-extension] 115 | uint8_t buffer[bufferSize]; | ^~~~~~~~~~ src/Flasher.cpp:115:28: note: read of non-const variable 'bufferSize' is not allowed in a constant expression src/Flasher.cpp:114:22: note: declared here 114 | uint32_t bufferSize = _samba.writeBufferSize(); | ^ [... more of these ...] Since refactoring the code to no longer use VLAs is rather intrusive, suppress the warnings instead. While here, pet portlint. PR: 276804 Approved by: maintainer timeout (2 weeks) MFH: 2024Q1 devel/bossa/Makefile | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-)
A commit in branch 2024Q1 references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=9c744e2660ed1445a4b8453ec3fcdeba11e28f5a commit 9c744e2660ed1445a4b8453ec3fcdeba11e28f5a Author: Dimitry Andric <dim@FreeBSD.org> AuthorDate: 2024-02-03 13:21:20 +0000 Commit: Dimitry Andric <dim@FreeBSD.org> CommitDate: 2024-02-24 11:06:04 +0000 devel/bossa: fix build with clang 18 Clang 18 has a new warning about variable length arrays used in C++, which is emitted when building devel/bossa: src/Flasher.cpp:115:28: error: variable length arrays in C++ are a Clang extension [-Werror,-Wvla-cxx-extension] 115 | uint8_t buffer[bufferSize]; | ^~~~~~~~~~ src/Flasher.cpp:115:28: note: read of non-const variable 'bufferSize' is not allowed in a constant expression src/Flasher.cpp:114:22: note: declared here 114 | uint32_t bufferSize = _samba.writeBufferSize(); | ^ [... more of these ...] Since refactoring the code to no longer use VLAs is rather intrusive, suppress the warnings instead. While here, pet portlint. PR: 276804 Approved by: maintainer timeout (2 weeks) MFH: 2024Q1 (cherry picked from commit 30a231f8eb872f67eac8514ba96da91cc4b9f44f) devel/bossa/Makefile | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-)