This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: don't use tentative declarations
Type: Stage: resolved
Components: Build Versions: Python 3.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: benjamin.peterson, pitrou
Priority: normal Keywords: patch

Created on 2017-12-31 05:32 by benjamin.peterson, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 5061 merged benjamin.peterson, 2017-12-31 05:33
Messages (4)
msg309269 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2017-12-31 05:32
Tentative declarations (non-extern declarations without initializers) are legacy C-ism that we should eschew by ensuring all our declarations have initializers.
msg309292 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2017-12-31 17:28
Sounds like good hygiene to me, though I didn't know that "tentative declarations" were legacy (don't they simply mean the variable gets an arbitrary initialization value?).
msg309294 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2017-12-31 18:02
If no definition provides an initializer, they'll end up initialized to 0. The legacy part is that you can have multiple tentative definitions of a symbol and most unix linkers will merge them.
msg309295 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2017-12-31 18:04
New changeset 0a37a30037073a4a9ba45e560c8445048e5f2ba2 by Benjamin Peterson in branch 'master':
closes bpo-32460: ensure all non-static globals have initializers (#5061)
https://github.com/python/cpython/commit/0a37a30037073a4a9ba45e560c8445048e5f2ba2
History
Date User Action Args
2022-04-11 14:58:56adminsetgithub: 76641
2017-12-31 18:04:16benjamin.petersonsetstatus: open -> closed
resolution: fixed
messages: + msg309295

stage: patch review -> resolved
2017-12-31 18:02:17benjamin.petersonsetmessages: + msg309294
2017-12-31 17:28:56pitrousetnosy: + pitrou
messages: + msg309292
2017-12-31 05:33:43benjamin.petersonsetkeywords: + patch
stage: patch review
pull_requests: + pull_request4937
2017-12-31 05:32:37benjamin.petersoncreate