Skip to content

Commit ff0a9ae

Browse files
gh-126877: Fix the configure check for Tcl/Tk with optimizing compilers (GH-153543)
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. Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 77cb756 commit ff0a9ae

3 files changed

Lines changed: 6 additions & 4 deletions

File tree

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Fix the :program:`configure` check for Tcl/Tk which could wrongly succeed
2+
with optimizing compilers when the libraries are missing.

configure

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

configure.ac

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4618,8 +4618,8 @@ WITH_SAVE_ENV([
46184618
# error "Tk older than 8.5.12 not supported"
46194619
#endif
46204620
], [
4621-
void *x1 = Tcl_Init;
4622-
void *x2 = Tk_Init;
4621+
Tcl_Init(NULL);
4622+
Tk_Init(NULL);
46234623
])
46244624
], [
46254625
have_tcltk=yes

0 commit comments

Comments
 (0)