TIP 666: Change ptrdiff_t → Tcl_Size in Tcl 8.7 (and 9.0)

Login
Author:		Jan Nijtmans <[email protected]>
State:		Final
Type:		Project
Vote:		Done
Created:	03-05-2023
Tcl-Version:	8.7
Tcl-Branch:	tip-666
Vote-Summary:	Accepted 5/0/0
Votes-For:	AK, BG, JN, KW, SL
Votes-Against:	none
Votes-Present:	none

Abstract

The TIPs 627 and 630 prepared the Tcl 8.7 (and 9.0) API to be able to use more than 2**31 arguments in all commands, even though that wasn't possible internally yet. This TIP proposes to use Tcl_Size in stead of ptrdiff_t for all functions mentioned in those 2 TIP's.

In this way, most of the TIP #627/#630 implementations vanishes in Tcl 8.7 (but not in 9.0).

Rationale

When TIPs 627 and 630 were implemented, the Tcl_Size type didn't exist yet. Therefore, the extension to 64-bit was targeted (but not really functional) to 8.7, and forwarded to 9.0. Now that Tcl_Size exists, it makes more sense to remove those 64-bit functions from 8.7, so target those 2 TIP's to 9.0 in stead of 8.7.

Implementation

Implementation is in Tcl branch "tip-666" for Tcl 8.7.

Part of the implementation for Tcl 9.0 is already committed to trunk, ignoring the requirement that Tcl 9.0 should be as much as possible source-compatible 8.7.

Compatibility

This change is 100% upwards compatible for 9.0, but not for 8.7. It will no longer be possible to use ptrdiff_t for the functions mentioned in TIP #627 and TIP #630, extensions will have to use Tcl_Size in stead.

Copyright

This document has been placed in the public domain.