René's URL Explorer Experiment


Title: Tkinter: incompatible pointer types warnings when built with Tcl 9 · Issue #112672 · python/cpython · GitHub

Open Graph Title: Tkinter: incompatible pointer types warnings when built with Tcl 9 · Issue #112672 · python/cpython

X Title: Tkinter: incompatible pointer types warnings when built with Tcl 9 · Issue #112672 · python/cpython

Description: Tcl/Tk 9 changes C APIs to use a different type for sizes to allow transferring ≥32-bit sized things. The new type is Tcl_Size, which as of TIP 660 is defined as either ptrdiff_t in Tcl 9, or int in Tcl 8.7 for binary compatibility. My i...

Open Graph Description: Tcl/Tk 9 changes C APIs to use a different type for sizes to allow transferring ≥32-bit sized things. The new type is Tcl_Size, which as of TIP 660 is defined as either ptrdiff_t in Tcl 9, or int i...

X Description: Tcl/Tk 9 changes C APIs to use a different type for sizes to allow transferring ≥32-bit sized things. The new type is Tcl_Size, which as of TIP 660 is defined as either ptrdiff_t in Tcl 9, or int i...

Opengraph URL: https://github.com/python/cpython/issues/112672

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Tkinter: incompatible pointer types warnings when built with Tcl 9","articleBody":"Tcl/Tk 9 changes C APIs to use a different type for sizes to allow transferring ≥32-bit sized things. The new type is `Tcl_Size`, which as of [TIP 660](https://core.tcl-lang.org/tips/doc/trunk/tip/660.md) is defined as either `ptrdiff_t` in Tcl 9, or `int` in Tcl 8.7 for binary compatibility.\r\n\r\nMy impression is that Tcl/Tk wrappers such as Tkinter, which are primarily used for Tk GUI, have little if any need for this. But as of [TIP 664](https://core.tcl-lang.org/tips/doc/trunk/tip/664.md), usage of APIs which previously expected `int *` must be updated for Tcl 9. There was previously effort in Tcl to continue allowing `int *` usage for compatibility, and maybe that would have been good enough for Tkinter, but others in the Tcl/Tk inner circle (who already wish to abandon Tcl/Tk \u003c 9 entirely) rejected that approach. `-Wincompatible-pointer-types` warnings now seen under Tcl 9:\r\n\r\n```\r\n./Modules/_tkinter.c:504:21: warning: incompatible pointer types passing 'int *' to parameter of type 'Tcl_Size *' (aka 'long *') [-Wincompatible-pointer-types]\r\n  504 |     const char *s = Tcl_GetStringFromObj(value, \u0026len);\r\n      |                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\ntcl90/include/tclDecls.h:4235:36: note: expanded from macro 'Tcl_GetStringFromObj'\r\n 4235 |                 (Tcl_GetStringFromObj)((objPtr), (sizePtr)))\r\n      |                                                  ^~~~~~~~~\r\ntcl90/include/tclDecls.h:1754:15: note: passing argument to parameter 'lengthPtr' here\r\n 1754 |                                 Tcl_Size *lengthPtr);\r\n      |                                           ^\r\n./Modules/_tkinter.c:1138:29: warning: incompatible pointer types passing 'int *' to parameter of type 'Tcl_Size *' (aka 'long *') [-Wincompatible-pointer-types]\r\n 1138 |         char *data = (char*)Tcl_GetByteArrayFromObj(value, \u0026size);\r\n      |                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\ntcl90/include/tclDecls.h:4229:41: note: expanded from macro 'Tcl_GetByteArrayFromObj'\r\n 4229 |                 (Tcl_GetBytesFromObj)(NULL, (objPtr), (sizePtr)))\r\n      |                                                       ^~~~~~~~~\r\ntcl90/include/tclDecls.h:1751:32: note: passing argument to parameter 'numBytesPtr' here\r\n 1751 |                                 Tcl_Obj *objPtr, Tcl_Size *numBytesPtr);\r\n      |                                                            ^\r\n./Modules/_tkinter.c:1168:18: warning: incompatible pointer types passing 'int *' to parameter of type 'Tcl_Size *' (aka 'long *') [-Wincompatible-pointer-types]\r\n 1168 |         status = Tcl_ListObjLength(interp, value, \u0026size);\r\n      |                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\ntcl90/include/tclDecls.h:4244:44: note: expanded from macro 'Tcl_ListObjLength'\r\n 4244 |                 (Tcl_ListObjLength)((interp), (listPtr), (lengthPtr)))\r\n      |                                                          ^~~~~~~~~~~\r\ntcl90/include/tclDecls.h:1790:33: note: passing argument to parameter 'lengthPtr' here\r\n 1790 |                                 Tcl_Obj *listPtr, Tcl_Size *lengthPtr);\r\n      |                                                             ^\r\n./Modules/_tkinter.c:2104:13: warning: incompatible pointer types passing 'int *' to parameter of type 'Tcl_Size *' (aka 'long *') [-Wincompatible-pointer-types]\r\n 2104 |         if (Tcl_ListObjGetElements(Tkapp_Interp(self),\r\n      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\n 2105 |                                    ((PyTclObject*)arg)-\u003evalue,\r\n      |                                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\n 2106 |                                    \u0026objc, \u0026objv) == TCL_ERROR) {\r\n      |                                    ~~~~~~~~~~~~~\r\ntcl90/include/tclDecls.h:4241:49: note: expanded from macro 'Tcl_ListObjGetElements'\r\n 4241 |                 (Tcl_ListObjGetElements)((interp), (listPtr), (objcPtr), (objvPtr)))\r\n      |                                                               ^~~~~~~~~\r\ntcl90/include/tclDecls.h:1786:33: note: passing argument to parameter 'objcPtr' here\r\n 1786 |                                 Tcl_Obj *listPtr, Tcl_Size *objcPtr,\r\n      |                                                             ^\r\n./Modules/_tkinter.c:2136:9: warning: incompatible pointer types passing 'int *' to parameter of type 'Tcl_Size *' (aka 'long *') [-Wincompatible-pointer-types]\r\n 2136 |     if (Tcl_SplitList(Tkapp_Interp(self), list,\r\n      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\n 2137 |                       \u0026argc, \u0026argv) == TCL_ERROR)  {\r\n      |                       ~~~~~~~~~~~~~\r\ntcl90/include/tclDecls.h:4250:40: note: expanded from macro 'Tcl_SplitList'\r\n 4250 |                 (Tcl_SplitList)((interp), (listStr), (argcPtr), (argvPtr)))\r\n      |                                                      ^~~~~~~~~\r\ntcl90/include/tclDecls.h:1796:36: note: passing argument to parameter 'argcPtr' here\r\n 1796 |                                 const char *listStr, Tcl_Size *argcPtr,\r\n      |                                                                ^\r\n5 warnings generated.\r\n```\r\n\r\nCode intending to remain compatible with Tcl 8.6 is suggested to use the following after including tcl.h:\r\n\r\n```\r\n#ifndef TCL_SIZE_MAX\r\ntypedef int Tcl_Size;\r\n# define Tcl_GetSizeIntFromObj Tcl_GetIntFromObj\r\n# define Tcl_NewSizeIntObj Tcl_NewIntObj\r\n# define TCL_SIZE_MAX      INT_MAX\r\n# define TCL_SIZE_MODIFIER \"\"\r\n#endif\r\n```\r\n\r\nI intend to open a PR updating _tkinter.c to pass `Tcl_Size *` where needed.\r\n\r\nThere are several other instances where Tkinter assumes Tcl expects`int` or something not larger than `INT_MAX`, but migrating those to `Tcl_Size` and `TCL_SIZE_MAX` seems optional.\r\n\r\n\u003c!-- gh-linked-prs --\u003e\r\n### Linked PRs\r\n* gh-112681\r\n* gh-120208\n* gh-120209\n\u003c!-- /gh-linked-prs --\u003e\r\n","author":{"url":"https://github.com/chrstphrchvz","@type":"Person","name":"chrstphrchvz"},"datePublished":"2023-12-03T20:19:54.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":2},"url":"https://github.com/112672/cpython/issues/112672"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:f9272e17-3d75-b7cc-2c44-1d35848be1d3
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idC6CC:BB754:17CD14:2124C3:696A4005
html-safe-nonce7e5f177bd7195ac57672c17ff8f7c21be5db8a2f760557387a771de6be45aa8c
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDNkNDOkJCNzU0OjE3Q0QxNDoyMTI0QzM6Njk2QTQwMDUiLCJ2aXNpdG9yX2lkIjoiMjE2NTU2MTMzNDYyMTE1OTQyOSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmacb8bf23d7340aed069bd6790e4dbab4d5590b3ed8521057237eff398a46aaa1ca
hovercard-subject-tagissue:2022698890
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/cpython/112672/issue_layout
twitter:imagehttps://opengraph.githubassets.com/9c67e9c42a1f73bbef4bc6e3d5c9d1e247827c424d951e46cee8f5bac645237d/python/cpython/issues/112672
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/9c67e9c42a1f73bbef4bc6e3d5c9d1e247827c424d951e46cee8f5bac645237d/python/cpython/issues/112672
og:image:altTcl/Tk 9 changes C APIs to use a different type for sizes to allow transferring ≥32-bit sized things. The new type is Tcl_Size, which as of TIP 660 is defined as either ptrdiff_t in Tcl 9, or int i...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamechrstphrchvz
hostnamegithub.com
expected-hostnamegithub.com
None3f871c8e07f0ae1886fa8dac284166d28b09ad5bada6476fc10b674e489788ef
turbo-cache-controlno-preview
go-importgithub.com/python/cpython git https://github.com/python/cpython.git
octolytics-dimension-user_id1525981
octolytics-dimension-user_loginpython
octolytics-dimension-repository_id81598961
octolytics-dimension-repository_nwopython/cpython
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id81598961
octolytics-dimension-repository_network_root_nwopython/cpython
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release63c426b30d262aba269ef14c40e3c817b384cd61
ui-targetcanary-1
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/python/cpython/issues/112672#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fissues%2F112672
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub SparkBuild and deploy intelligent appshttps://github.com/features/spark
GitHub ModelsManage and compare promptshttps://github.com/features/models
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fissues%2F112672
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=python%2Fcpython
Reloadhttps://github.com/python/cpython/issues/112672
Reloadhttps://github.com/python/cpython/issues/112672
Reloadhttps://github.com/python/cpython/issues/112672
python https://github.com/python
cpythonhttps://github.com/python/cpython
Please reload this pagehttps://github.com/python/cpython/issues/112672
Notifications https://github.com/login?return_to=%2Fpython%2Fcpython
Fork 33.9k https://github.com/login?return_to=%2Fpython%2Fcpython
Star 71.1k https://github.com/login?return_to=%2Fpython%2Fcpython
Code https://github.com/python/cpython
Issues 5k+ https://github.com/python/cpython/issues
Pull requests 2.1k https://github.com/python/cpython/pulls
Actions https://github.com/python/cpython/actions
Projects 31 https://github.com/python/cpython/projects
Security Uh oh! There was an error while loading. Please reload this page. https://github.com/python/cpython/security
Please reload this pagehttps://github.com/python/cpython/issues/112672
Insights https://github.com/python/cpython/pulse
Code https://github.com/python/cpython
Issues https://github.com/python/cpython/issues
Pull requests https://github.com/python/cpython/pulls
Actions https://github.com/python/cpython/actions
Projects https://github.com/python/cpython/projects
Security https://github.com/python/cpython/security
Insights https://github.com/python/cpython/pulse
New issuehttps://github.com/login?return_to=https://github.com/python/cpython/issues/112672
New issuehttps://github.com/login?return_to=https://github.com/python/cpython/issues/112672
Tkinter: incompatible pointer types warnings when built with Tcl 9https://github.com/python/cpython/issues/112672#top
https://github.com/serhiy-storchaka
3.12only security fixeshttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%223.12%22
3.13bugs and security fixeshttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%223.13%22
3.14bugs and security fixeshttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%223.14%22
topic-tkinterhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22topic-tkinter%22
https://github.com/chrstphrchvz
https://github.com/chrstphrchvz
chrstphrchvzhttps://github.com/chrstphrchvz
on Dec 3, 2023https://github.com/python/cpython/issues/112672#issue-2022698890
TIP 660https://core.tcl-lang.org/tips/doc/trunk/tip/660.md
TIP 664https://core.tcl-lang.org/tips/doc/trunk/tip/664.md
gh-112672: use Tcl_Size to avoid incompatible pointer type warnings #112681https://github.com/python/cpython/pull/112681
[3.13] gh-112672: Fix builtin Tkinter with Tcl 9.0 (GH-112681) #120208https://github.com/python/cpython/pull/120208
[3.12] gh-112672: Fix builtin Tkinter with Tcl 9.0 (GH-112681) #120209https://github.com/python/cpython/pull/120209
serhiy-storchakahttps://github.com/serhiy-storchaka
3.12only security fixeshttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%223.12%22
3.13bugs and security fixeshttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%223.13%22
3.14bugs and security fixeshttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%223.14%22
topic-tkinterhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22topic-tkinter%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.