View Ticket
Not logged in
Ticket UUID: a550f9710b0c45541762466ec6833de36698f52
Title: format %s does not support long strings in uncompiled
Type: Bug Version: 9.0
Submitter: apnadkarni Created on: 2023-04-09 16:07:36
Subsystem: 16. Commands A-H Assigned To: nobody
Priority: 5 Medium Severity: Minor
Status: Closed Last Modified: 2023-04-24 12:58:00
Resolution: Fixed Closed By: apnadkarni
    Closed on: 2023-04-24 12:58:00
Description:
`format %s` functions correctly when byte compiled but not with direct eval.

```
% set s [testbigdata string 0x100000000] ; string length $s
4294967296
% string range [format %s $s] end-9 end
6789012345
% set format format
format
% string range [$format %s $s] end-9 end
max size for a Tcl value exceeded
```
User Comments: apnadkarni added on 2023-04-24 12:58:00:
Fixed in [0cb8f90d77].

apnadkarni added on 2023-04-09 16:36:24:
A variant, where the format string itself is long, does not work in either compiled or uncompiled modes.

```
% set s [testbigdata string 0x100000000] ; string length $s
4294967296
% append s %s ; string length $s
4294967298
% string length [format $s X]
max size for a Tcl value exceeded
% string length [$format $s X]
max size for a Tcl value exceeded
```

Further, large values for precision and width raise the same error.