The check assigned the addresses of Tcl_Init() and Tk_Init() to unused
variables, which optimizing compilers can eliminate, so it linked even
when the libraries were missing. Call the functions instead.
(cherry picked from commit
ff0a9ae269fa38c21f01bdea1a7ff5d439c4f681)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
--- /dev/null
+Fix the :program:`configure` check for Tcl/Tk which could wrongly succeed
+with optimizing compilers when the libraries are missing.
main (void)
{
- void *x1 = Tcl_Init;
- void *x2 = Tk_Init;
+ Tcl_Init(NULL);
+ Tk_Init(NULL);
;
return 0;
# error "Tk older than 8.5.12 not supported"
#endif
], [
- void *x1 = Tcl_Init;
- void *x2 = Tk_Init;
+ Tcl_Init(NULL);
+ Tk_Init(NULL);
])
], [
have_tcltk=yes