Skip to content
Tcl Source Code View Ticket
Login

View Ticket

format %s does not support long strings in uncompiled

Closed / Fixeda550f9710b0c45541762466ec6833de36698f52fCreated 4 years agoUpdated 4 years ago
Descriptionmarkdown2023-04-09 16:07:36

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
Referenced by1
apnadkarniplain2023-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.
apnadkarniplain2023-04-24 12:58:00
Fixed in [0cb8f90d77].
Log in (anonymous is fine) to add a comment.