Many thanks Gustaf for creating the patch, I can confirm this works.
I also saw the fix has been applied to TCL core too.

Regards,
David F


-----Original Message-----
From: Gustaf <neum...@wu.ac.at>
To: naviserver-devel <naviserver-devel@lists.sourceforge.net>
Date: Monday, 22 April 2024 6:08 PM GMT
Subject: Re: [naviserver-devel] FreeBSD 14 - TCL 9.0 - NaviServer GIT Latest - 
error: incompatible function pointer - log.c


Dear David,

I installed freebsd14 and could reproduce the issue. The issue is that 
Tcl_PanicProc is defined in Tcl9 with the attribute declaration TCL_NORETURN1, 
but it seems, this attribute definition has to be provided as well for the  
prototype. It would be certainly better, if this attribute definition would be 
part of the type declaration of Tcl_PanicProc in Tcl9. Not very long ago, the 
same code worked fine, so something has changed in Tcl9.

The patch below addresses this issue, but this is not nice. Maybe, the tcl-core 
people have a suggestion, since this will effect as well other applications 
requiring the use of Tcl_SetPanicProc().

Please update your checkout of NaviServer from git, since i have fixed one more 
small issues unrelated to this.

all the best
-g


--- a/nsd/log.c
+++ b/nsd/log.c
@@ -96,7 +96,11 @@ static void LogEntriesFree(void *arg);
  */
 
 static Ns_TlsCleanup FreeCache;
-static Tcl_PanicProc Panic;
+static
+#ifndef NS_TCL_PRE9
+ TCL_NORETURN1
+#endif
+ Tcl_PanicProc Panic;
 
 static Ns_LogFilter LogToFile;
 static Ns_LogFilter LogToTcl;




> On 21.04.2024, at 16:18, Not Spam <uns...@crystalforest.tf> wrote:
> 
> Good afternoon,
> I'm currently rebuilding my machine and I am having some issues with 
> NaviServer (4.99-main #defd765) compiling on FreeBSD 14, with TCL 9.0b2 or 
> TCL 9.0b1
>  
> TCL 9.0b1
> ===
> cc  -O2 -Wall -fPIC  -pipe -finput-charset=UTF-8  -DNDEBUG -DSYSTEM_MALLOC 
> -std=c99 -I../include -I"/usr/local/include"   -DHAVE_CONFIG_H   -c -o log.o 
> log.c
> log.c:262:22: error: incompatible function pointer types passing 
> 'Tcl_PanicProc' (aka 'void (const char *, ...)') to parameter of type 'void 
> (*)(const char *, ...) __attribute__((noreturn))' 
> [-Wincompatible-function-pointer-types]
>     Tcl_SetPanicProc(Panic);
>                      ^~~~~
> /usr/local/include/tcl.h:2366:37: note: passing argument to parameter 
> 'panicProc' here
>                             TCL_NORETURN1 Tcl_PanicProc *panicProc);
>                                                                               
>        ^
>  
> TCL 9.0b2
> ===
> cc  -O2 -Wall -fPIC  -pipe -finput-charset=UTF-8  -DNDEBUG -DSYSTEM_MALLOC 
> -std=c99 -I../include -I"/usr/local/include"   -DHAVE_CONFIG_H   -c -o log.o 
> log.c
> log.c:262:22: error: incompatible function pointer types passing 
> 'Tcl_PanicProc' (aka 'void (const char *, ...)') to parameter of type 'void 
> (*)(const char *, ...) __attribute__((noreturn))' 
> [-Wincompatible-function-pointer-types]
>     Tcl_SetPanicProc(Panic);
>                      ^~~~~
> /usr/local/include/tcl.h:2366:37: note: passing argument to parameter 
> 'panicProc' here
>                             TCL_NORETURN1 Tcl_PanicProc *panicProc);
>                                                                               
>        ^
> 1 error generated.
>  
> I'm using the latest GIT repo version.
> Any advice would be nice, I wish to use the ZIPFS that TCL9 brings.
>  
> Regards,
> David F
> _______________________________________________
> naviserver-devel mailing list
> naviserver-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/naviserver-devel

_______________________________________________
naviserver-devel mailing list
naviserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/naviserver-devel


_______________________________________________
naviserver-devel mailing list
naviserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/naviserver-devel

Reply via email to