Skip to content

Commit a73c58f

Browse files
miss-islingtonserhiy-storchakaclaude
authored
[3.13] gh-126877: Fix the configure check for Tcl/Tk with optimizing compilers (GH-153543) (GH-153555)
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 7aecef4 commit a73c58f

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
@@ -4445,8 +4445,8 @@ WITH_SAVE_ENV([
44454445
# error "Tk older than 8.5.12 not supported"
44464446
#endif
44474447
], [
4448-
void *x1 = Tcl_Init;
4449-
void *x2 = Tk_Init;
4448+
Tcl_Init(NULL);
4449+
Tk_Init(NULL);
44504450
])
44514451
], [
44524452
have_tcltk=yes

0 commit comments

Comments
 (0)