diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2024-02-01 09:08:36 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2024-02-01 09:08:36 (GMT) |
commit | 4d8f46acdb3620b30c180b26aec6ea51a3b404a6 (patch) | |
tree | 67cee52845860a3e66f78207c3abc735afb00adf | |
parent | b0b50752804a4ae7921d7c6aacc089c3c756cf65 (diff) | |
download | tcl-4d8f46acdb3620b30c180b26aec6ea51a3b404a6.zip tcl-4d8f46acdb3620b30c180b26aec6ea51a3b404a6.tar.gz tcl-4d8f46acdb3620b30c180b26aec6ea51a3b404a6.tar.bz2 |
Update Tcl_ObjPrintf() documentation. Make it more clear that C11 format specifiers are not supported.
-rw-r--r-- | doc/StringObj.3 | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/doc/StringObj.3 b/doc/StringObj.3 index aea8d62..9ce4d16 100644 --- a/doc/StringObj.3 +++ b/doc/StringObj.3 @@ -316,9 +316,10 @@ sprintf(buf, format, ...); but with greater convenience and no need to determine \fBSOME_SUITABLE_LENGTH\fR. The formatting is done with the same core formatting engine used by \fBTcl_Format\fR. This means the set of -supported conversion specifiers is that of the \fBformat\fR command and -not that of the \fBsprintf\fR routine where the two sets differ. When a -conversion specifier passed to \fBTcl_ObjPrintf\fR includes a precision, +supported conversion specifiers is that of the \fBformat\fR command but +the behavior is as similar as possible to \fBsprintf\fR. Format specifiers +which were added by C99 (like "hh", "ll", "j", "z", "t", "L") are not supported. +When a conversion specifier passed to \fBTcl_ObjPrintf\fR includes a precision, the value is taken as a number of bytes, as \fBsprintf\fR does, and not as a number of characters, as \fBformat\fR does. This is done on the assumption that C code is more likely to know how many bytes it is |