Bug 902561 - build fails with tcl 8.6: error: ‘Tcl_Interp’ has no member named ‘result’
Summary: build fails with tcl 8.6: error: ‘Tcl_Interp’ has no member named ‘result’
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Fedora
Classification: Fedora
Component: newt
Version: rawhide
Hardware: All
OS: All
unspecified
medium
Target Milestone: ---
Assignee: Miroslav Lichvar
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-01-21 23:51 UTC by redhat
Modified: 2019-09-04 02:02 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-03-20 15:44:57 UTC
Type: Bug


Attachments (Terms of Use)
Patch to make whiptcl.c work with Tcl 8.6 (3.04 KB, patch)
2019-09-02 04:30 UTC, Sato Ichi
no flags Details | Diff
Patch for newt.spec to include whiptcl.so (508 bytes, patch)
2019-09-02 04:32 UTC, Sato Ichi
no flags Details | Diff
Tcl script to test whiptcl functionality in Newt (155 bytes, text/plain)
2019-09-02 04:41 UTC, Sato Ichi
no flags Details

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):
0.52.14

How reproducible:
Always

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.


Note You need to log in before you can comment on or make changes to this bug.