Bug 902561

Summary: build fails with tcl 8.6: error: ‘Tcl_Interp’ has no member named ‘result’
Product: [Fedora] Fedora Reporter: redhat
Component: newtAssignee: Miroslav Lichvar <mlichvar>
Status: CLOSED UPSTREAM QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: rawhideCC: kalvdans, mlichvar, sato_ichi
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: All   
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-03-20 15:44:57 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Description Flags
Patch to make whiptcl.c work with Tcl 8.6
Patch for newt.spec to include whiptcl.so
Tcl script to test whiptcl functionality in Newt none

Description redhat 2013-01-21 23:51:43 UTC
Description of problem:
Building newt 0.52.14 fails with tcl 8.6.0 with the message "error: ‘Tcl_Interp’ has no member named ‘result’" and other similar errors.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. Install Tcl 8.6
2. Try to build newt 0.52.14 against Tcl 8.6
Actual results:
error: ‘Tcl_Interp’ has no member named ‘result’

Expected results:
Successful build.

Additional info:
Workaround: add "-DUSE_INTERP_RESULT" to CPPFLAGS.

Solution: stop using fields inside Tcl_Interp; they are deprecated and the above workaround will be removed in a future version of Tcl.

MacPorts bug report: https://trac.macports.org/ticket/37725

Your issue tracker required me to fill in the Version field, so I left it at its default, although I have no idea what version of Redhat Linux, if any, contains this version of newt; I do not use Redhat Linux.

Comment 1 Miroslav Lichvar 2013-03-20 15:44:57 UTC
Thanks for the report.

In git, the CPPFLAGS now have -DUSE_INTERP_RESULT when building with tcl support. Patches removing the use of the result field are welcome.

Comment 2 Sato Ichi 2019-09-02 04:30:19 UTC
Created attachment 1610645 [details]
Patch to make whiptcl.c work with Tcl 8.6

Replaced interp->result calls with updated Tcl functions

Comment 3 Sato Ichi 2019-09-02 04:32:08 UTC
Created attachment 1610646 [details]
Patch for newt.spec to include whiptcl.so

Enables Tcl support for newt

Comment 4 Sato Ichi 2019-09-02 04:41:13 UTC
Created attachment 1610649 [details]
Tcl script to test whiptcl functionality in Newt

Comment 5 Miroslav Lichvar 2019-09-03 07:38:16 UTC
Thanks for the patch. I'm getting different warnings like:

whiptcl.c:141:10: warning: passing argument 1 of ‘sprintf’ discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
whiptcl.c:149:27: warning: passing argument 2 of ‘Tcl_SetObjResult’ from incompatible pointer type [-Wincompatible-pointer-types]

I'm not familiar with the API and I'm not sure if it would be ok to just cast the arguments.

If you have a different patch, please submit it on https://pagure.io/newt.

Comment 6 Sato Ichi 2019-09-04 02:02:37 UTC
It's OK to ignore those warnings. I built the newt, newt-devel, python2-newt and python3-newt packages for Fedora 30 from the newt SRPM using that patch and the Tcl functionality worked fine.