Skip to content

Commit 5e49eaa

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 43e621e commit 5e49eaa

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
@@ -4643,8 +4643,8 @@ WITH_SAVE_ENV([
46434643
# error "Tk older than 8.5.12 not supported"
46444644
#endif
46454645
], [
4646-
void *x1 = Tcl_Init;
4647-
void *x2 = Tk_Init;
4646+
Tcl_Init(NULL);
4647+
Tk_Init(NULL);
46484648
])
46494649
], [
46504650
have_tcltk=yes

0 commit comments

Comments
 (0)