Skip to content

Commit 4c935ab

Browse files
serhiy-storchakaclaude
authored andcommitted
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. (cherry picked from commit ff0a9ae) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com> Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 58330cf commit 4c935ab

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
@@ -4544,8 +4544,8 @@ WITH_SAVE_ENV([
45444544
# error "Tk older than 8.5.12 not supported"
45454545
#endif
45464546
], [
4547-
void *x1 = Tcl_Init;
4548-
void *x2 = Tk_Init;
4547+
Tcl_Init(NULL);
4548+
Tk_Init(NULL);
45494549
])
45504550
], [
45514551
have_tcltk=yes

0 commit comments

Comments
 (0)