git: 9c744e2660ed - 2024Q1 - devel/bossa: fix build with clang 18

From: Dimitry Andric <dim_at_FreeBSD.org>
Date: Sat, 24 Feb 2024 11:06:17 UTC
The branch 2024Q1 has been updated by dim:

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(-)

diff --git a/devel/bossa/Makefile b/devel/bossa/Makefile
index ddffddb09b6c..9d0e48e37107 100644
--- a/devel/bossa/Makefile
+++ b/devel/bossa/Makefile
@@ -1,5 +1,6 @@
 PORTNAME=	bossa
 PORTVERSION=	1.9.1
+PORTREVISION=	1
 CATEGORIES=	devel
 
 MAINTAINER=	kevans@FreeBSD.org
@@ -9,12 +10,12 @@ WWW=		https://github.com/shumatech/BOSSA
 LICENSE=	BSD3CLAUSE
 LICENSE_FILE=	${WRKSRC}/LICENSE
 
+USES=		compiler:c++11-lang gmake
+
 USE_GITHUB=	yes
 GH_ACCOUNT=	shumatech
 GH_PROJECT=	${PORTNAME:tu}
 
-USES=		compiler:c++11-lang gmake
-
 CXXFLAGS+=	-I${PREFIX}/include
 LDFLAGS+=	-L${PREFIX}/lib
 
@@ -32,6 +33,12 @@ BOSSASH_DESC=		Include BOSSA Shell
 BOSSASH_USES=		readline
 BOSSASH_ALL_TARGET=	bin/bossash
 
+.include <bsd.port.pre.mk>
+
+.if ${COMPILER_TYPE} == clang && ${COMPILER_VERSION} >= 180
+CXXFLAGS+=		-Wno-vla-cxx-extension
+.endif
+
 post-extract:
 	${REINPLACE_CMD} -e 's/wx-config/$${WX_CONFIG}/' ${WRKSRC}/Makefile
 
@@ -44,4 +51,4 @@ do-install-BOSSA-on:
 do-install-BOSSASH-on:
 	${INSTALL_PROGRAM} ${WRKSRC}/bin/bossash ${STAGEDIR}${PREFIX}/bin/bossash
 
-.include <bsd.port.mk>
+.include <bsd.port.post.mk>