git: 77f8df9a0d07 - main - misc/tlci: Fix build with llvm15

From: Muhammad Moinur Rahman <bofh_at_FreeBSD.org>
Date: Sun, 11 Jun 2023 19:16:39 UTC
The branch main has been updated by bofh:

URL: https://cgit.FreeBSD.org/ports/commit/?id=77f8df9a0d07f9ca47461eb806a5c3e689830a76

commit 77f8df9a0d07f9ca47461eb806a5c3e689830a76
Author:     Muhammad Moinur Rahman <bofh@FreeBSD.org>
AuthorDate: 2023-06-11 19:14:30 +0000
Commit:     Muhammad Moinur Rahman <bofh@FreeBSD.org>
CommitDate: 2023-06-11 19:16:23 +0000

    misc/tlci: Fix build with llvm15
    
    Approved by:    portmgr (blanket)
---
 misc/tlci/Makefile                    |  8 ++++++++
 misc/tlci/files/patch-src_evaluator.c | 11 +++++++++++
 misc/tlci/files/patch-src_heap.c      | 11 +++++++++++
 misc/tlci/files/patch-src_lexer.l     | 20 ++++++++++++++++++++
 misc/tlci/files/patch-src_parser.y    | 11 +++++++++++
 misc/tlci/files/patch-src_tlci.c      | 11 +++++++++++
 6 files changed, 72 insertions(+)

diff --git a/misc/tlci/Makefile b/misc/tlci/Makefile
index 0bc1c9cfc831..1340aee2bd5b 100644
--- a/misc/tlci/Makefile
+++ b/misc/tlci/Makefile
@@ -16,6 +16,14 @@ GL_COMMIT=	4a3dd51a872f36a513f06efa475922259dee91f1
 PLIST_FILES=	${PREFIX}/bin/tlci \
 		${PREFIX}/man/man8/tlci.8.gz
 
+.include <bsd.port.options.mk>
+
+#post-patch:
+#.if ${OPSYS} == FreeBSD && ( ${OSVERSION} >= 1400079 || ( ${OSVERSION} >= 1302505 && ${OSVERSION} < 1400000 ))
+#	@${REINPLACE_CMD} -e 's|^CFLAGS\+=|CFLAGS\+=	-Wno-error=strict-prototypes |g' \
+#		${WRKSRC}/Makefile
+#.endif
+
 post-install:
 	${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/tlci
 
diff --git a/misc/tlci/files/patch-src_evaluator.c b/misc/tlci/files/patch-src_evaluator.c
new file mode 100644
index 000000000000..c0202811ea10
--- /dev/null
+++ b/misc/tlci/files/patch-src_evaluator.c
@@ -0,0 +1,11 @@
+--- src/evaluator.c.orig	2023-06-11 19:02:44 UTC
++++ src/evaluator.c
+@@ -192,7 +192,7 @@ void eval_init(jmp_buf* error_handler)
+     memcpy(&on_error, error_handler, sizeof(jmp_buf));
+ }
+ /*********************************************************************************/
+-string eval_get_error()
++string eval_get_error(void)
+ {
+     return (string) { .begin = error_msg, .len = strlen(error_msg) };
+ }
diff --git a/misc/tlci/files/patch-src_heap.c b/misc/tlci/files/patch-src_heap.c
new file mode 100644
index 000000000000..de1243385cfb
--- /dev/null
+++ b/misc/tlci/files/patch-src_heap.c
@@ -0,0 +1,11 @@
+--- src/heap.c.orig	2023-06-11 18:59:24 UTC
++++ src/heap.c
+@@ -34,7 +34,7 @@
+ static heap_cell_t* pool_alloc(heap_t*);
+ static void pool_swipe(heap_t*);
+ /******************************************************************************/
+-heap_t* heap_create()
++heap_t* heap_create(void)
+ {
+     heap_t* heap = calloc(1, sizeof(heap_t));
+     if (!heap) {
diff --git a/misc/tlci/files/patch-src_lexer.l b/misc/tlci/files/patch-src_lexer.l
new file mode 100644
index 000000000000..5abf330cec13
--- /dev/null
+++ b/misc/tlci/files/patch-src_lexer.l
@@ -0,0 +1,20 @@
+--- src/lexer.l.orig	2023-06-11 19:08:30 UTC
++++ src/lexer.l
+@@ -49,7 +49,7 @@ void reset_lexer(void)
+     YY_FLUSH_BUFFER;
+ }
+ /*********************************************************************************/
+-heap_cell_t* get_token_pos()
++heap_cell_t* get_token_pos(void)
+ {
+     return heap_alloc_token_pos(tlci_heap,
+         from_cstring(string_dup(filename)),
+@@ -61,7 +61,7 @@ void yyerror(char *s)
+     printf("%s:%d:%d: \033[31m%s:\033[0m Unexpected '%s'\n", filename, yylineno, tokenpos, s, yytext);
+ }
+ /*********************************************************************************/
+-void switch_to_stdin()
++void switch_to_stdin(void)
+ {
+     filename = "<interactive>";
+     yyin = stdin;
diff --git a/misc/tlci/files/patch-src_parser.y b/misc/tlci/files/patch-src_parser.y
new file mode 100644
index 000000000000..f1418faed9f7
--- /dev/null
+++ b/misc/tlci/files/patch-src_parser.y
@@ -0,0 +1,11 @@
+--- src/parser.y.orig	2023-06-11 19:00:49 UTC
++++ src/parser.y
+@@ -4,7 +4,7 @@
+ #include <tlci/heap.h>
+ #include <tlci/string.h>
+ extern heap_t* tlci_heap;
+-extern int yylex();
++extern int yylex(void);
+ extern void yyerror(const char*);
+ #define mkAP(f, a) \
+     heap_alloc_ap(tlci_heap, f, a)
diff --git a/misc/tlci/files/patch-src_tlci.c b/misc/tlci/files/patch-src_tlci.c
new file mode 100644
index 000000000000..c458d4472e54
--- /dev/null
+++ b/misc/tlci/files/patch-src_tlci.c
@@ -0,0 +1,11 @@
+--- src/tlci.c.orig	2023-06-11 19:01:46 UTC
++++ src/tlci.c
+@@ -46,7 +46,7 @@ extern void switch_to_stdin(void);
+ extern FILE* yyin;
+ 
+ /*********************************************************************************/
+-static void on_quit()
++static void on_quit(void)
+ {
+     heap_destroy(tlci_heap);
+ }