Skip to content
Tcl Source Code Artifact [86840b0f2a]
Login

Artifact [86840b0f2a]

Artifact 86840b0f2a0b779efef3d0423206976cdc96c25c347e8c89c6dbca2417f9208b:

Wiki page [branch/c11-printf-result] by dkf on 2025-10-23 12:58:21.
D 2025-10-23T12:58:21.797
L branch/c11-printf-result
N text/x-markdown
P af1ab761186d38f248c4e4faa4bf03ed476d16c2de57245fa51bd6608d316089
U dkf
W 690
This is based on the much wider changes in the [`c-std-update`](https://core.tcl-lang.org/tcl/timeline?r=c-std-update) branch.

This uses C11 variadic macros to create especially `TclPrintfResult()`, which gives us back approximately the feeling of doing `sprintf(interp->result, ...)` from Tcl 7, except now in a Tcl_Obj-safe way. It's been used in this branch almost entirely for handling errors, which are typically not regarded as performance-critical.

> This is a feature that is _recommended_ for adoption. We _may_ want to promote `TclPrintfResult()` to the public API; it requires no new functions, as it is only a source-level feature. That is **out of scope** of this branch.
Z 4cfa8f48c35845acc427d8e63f31ac52