summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--doc/ByteArrObj.37
-rw-r--r--doc/DictObj.36
-rw-r--r--doc/FileSystem.36
-rw-r--r--doc/ListObj.312
-rw-r--r--doc/ParseArgs.36
-rw-r--r--doc/SplitList.36
-rw-r--r--doc/SplitPath.36
-rw-r--r--doc/StringObj.35
-rw-r--r--generic/tclDate.c6
-rw-r--r--generic/tclDecls.h28
-rw-r--r--generic/tclGetDate.y4
-rw-r--r--unix/Makefile.in2
12 files changed, 62 insertions, 32 deletions
diff --git a/doc/ByteArrObj.3 b/doc/ByteArrObj.3
index 32e042f..70ebe04 100644
--- a/doc/ByteArrObj.3
+++ b/doc/ByteArrObj.3
@@ -45,9 +45,12 @@ to the value from which to extract an array of bytes.
Interpreter to use for error reporting.
.AP "Tcl_Size \&| int" *numBytesPtr out
Points to space where the number of bytes in the array may be written.
-Caller may pass NULL when it does not need this information.
+May be (Tcl_Size *)NULL when not used. If it points to a variable which
+type is not \fBTcl_Size\fR, a compiler warning will be generated, in
+order to indicate that when size of the byte array is larger than INT_MAX
+this function will return NULL (which should trigger proper error-handling).
+Apart from that, it will function as expected.
.BE
-
.SH DESCRIPTION
.PP
These routines are used to create, modify, store, transfer, and retrieve
diff --git a/doc/DictObj.3 b/doc/DictObj.3
index c046a42..8aa4ad1 100644
--- a/doc/DictObj.3
+++ b/doc/DictObj.3
@@ -72,7 +72,11 @@ placed within it. For \fBTcl_DictObjFirst\fR and
not interested in the value.
.AP "Tcl_Size \&| int" *sizePtr out
Points to a variable that will have the number of key/value pairs
-contained within the dictionary placed within it.
+contained within the dictionary placed within it. May be (Tcl_Size *)NULL when not used. If it points to a variable which
+type is not \fBTcl_Size\fR, a compiler warning will be generated, in
+order to indicate that when size of the dictionary is larger than INT_MAX
+this function will return TCL_ERROR (which should trigger proper error-handling).
+Apart from that, it will function as expected.
.AP Tcl_DictSearch *searchPtr in/out
Pointer to record to use to keep track of progress in enumerating all
key/value pairs in a dictionary. The contents of the record will be
diff --git a/doc/FileSystem.3 b/doc/FileSystem.3
index 0b1d6d5..86a46c7 100644
--- a/doc/FileSystem.3
+++ b/doc/FileSystem.3
@@ -270,7 +270,11 @@ allowed for the \fImode\fR argument to the Tcl \fBopen\fR command.
POSIX-style permission flags such as 0644. If a new file is created, these
permissions will be set on the created file.
.AP "Tcl_Size \&| int" *lenPtr out
-If non-NULL, filled with the number of elements in the split path.
+Filled with the number of elements in the split path. May be (Tcl_Size *)NULL when not used. If it points to a variable which
+type is not \fBTcl_Size\fR, a compiler warning will be generated, in
+order to indicate that when number of elements is larger than INT_MAX
+this function will return NULL (which should trigger proper error-handling).
+Apart from that, it will function as expected.
.AP Tcl_Obj *basePtr in
The base path on to which to join the given elements. May be NULL.
.AP Tcl_Size objc in
diff --git a/doc/ListObj.3 b/doc/ListObj.3
index f63556b..4445892 100644
--- a/doc/ListObj.3
+++ b/doc/ListObj.3
@@ -61,7 +61,11 @@ this points to the Tcl value that will be converted to a list value
containing the \fIobjc\fR elements of the array referenced by \fIobjv\fR.
.AP "Tcl_Size \&| int" *objcPtr in
Points to location where \fBTcl_ListObjGetElements\fR
-stores the number of element values in \fIlistPtr\fR.
+stores the number of element values in \fIlistPtr\fR. May be (Tcl_Size *)NULL when not used. If it points to a variable which
+type is not \fBTcl_Size\fR, a compiler warning will be generated, in
+order to indicate that when the list size is larger than INT_MAX
+this function will return TCL_ERROR (which should trigger proper error-handling).
+Apart from that, it will function as expected.
.AP Tcl_Obj ***objvPtr out
A location where \fBTcl_ListObjGetElements\fR stores a pointer to an array
of pointers to the element values of \fIlistPtr\fR.
@@ -78,7 +82,11 @@ and \fBTcl_ListObjReplace\fR will insert them into an existing \fIlistPtr\fR.
Each value will become a separate list element.
.AP "Tcl_Size \&| int" *lengthPtr out
Points to location where \fBTcl_ListObjLength\fR
-stores the length of the list.
+stores the length of the list. May be (Tcl_Size *)NULL when not used. If it points to a variable which
+type is not \fBTcl_Size\fR, a compiler warning will be generated, in
+order to indicate that when the list size is larger than INT_MAX
+this function will return TCL_ERROR (which should trigger proper error-handling).
+Apart from that, it will function as expected.
.AP Tcl_Size index in
Index of the list element that \fBTcl_ListObjIndex\fR
is to return.
diff --git a/doc/ParseArgs.3 b/doc/ParseArgs.3
index 7f81fb7..ab3b7d8 100644
--- a/doc/ParseArgs.3
+++ b/doc/ParseArgs.3
@@ -24,7 +24,11 @@ Pointer to array of option descriptors.
.AP "Tcl_Size \&| int" *objcPtr in/out
A pointer to variable holding number of arguments in \fIobjv\fR. Will be
modified to hold number of arguments left in the unprocessed argument list
-stored in \fIremObjv\fR.
+stored in \fIremObjv\fR. May be (Tcl_Size *)NULL when not used. If it points to a variable which
+type is not \fBTcl_Size\fR, a compiler warning will be generated, in
+order to indicate that when the number of elements is larger than INT_MAX
+this function will return TCL_ERROR (which should trigger proper error-handling).
+Apart from that, it will function as expected.
.AP "Tcl_Obj *const" *objv in
The array of arguments to be parsed.
.AP Tcl_Obj ***remObjv out
diff --git a/doc/SplitList.3 b/doc/SplitList.3
index cc156ee..2aa5e7c 100644
--- a/doc/SplitList.3
+++ b/doc/SplitList.3
@@ -39,7 +39,11 @@ is left.
.AP "const char" *list in
Pointer to a string with proper list structure.
.AP "Tcl_Size \&| int" *argcPtr out
-Filled in with number of elements in \fIlist\fR.
+Filled in with number of elements in \fIlist\fR. May be (Tcl_Size *)NULL when not used. If it points to a variable which
+type is not \fBTcl_Size\fR, a compiler warning will be generated, in
+order to indicate that when the list size is larger than INT_MAX
+this function will return TCL_ERROR (which should trigger proper error-handling).
+Apart from that, it will function as expected.
.AP "const char" ***argvPtr out
\fI*argvPtr\fR will be filled in with the address of an array of
pointers to the strings that are the extracted elements of \fIlist\fR.
diff --git a/doc/SplitPath.3 b/doc/SplitPath.3
index 1e90ab0..54e33da 100644
--- a/doc/SplitPath.3
+++ b/doc/SplitPath.3
@@ -26,7 +26,11 @@ Tcl_PathType
File path in a form appropriate for the current platform (see the
\fBfilename\fR manual entry for acceptable forms for path names).
.AP "Tcl_Size \&| int" *argcPtr out
-Filled in with number of path elements in \fIpath\fR.
+Filled in with number of path elements in \fIpath\fR. May be (Tcl_Size *)NULL when not used. If it points to a variable which
+type is not \fBTcl_Size\fR, a compiler warning will be generated, in
+order to indicate that when the number of elements is larger than INT_MAX
+this function will return TCL_ERROR (which should trigger proper error-handling).
+Apart from that, it will function as expected.
.AP "const char" ***argvPtr out
\fI*argvPtr\fR will be filled in with the address of an array of
pointers to the strings that are the extracted elements of \fIpath\fR.
diff --git a/doc/StringObj.3 b/doc/StringObj.3
index 28caae7..0da0e43 100644
--- a/doc/StringObj.3
+++ b/doc/StringObj.3
@@ -120,7 +120,10 @@ A pointer to a value to read, or to an unshared value to modify.
The value to append to \fIobjPtr\fR in \fBTcl_AppendObjToObj\fR.
.AP "Tcl_Size \&| int" *lengthPtr out
The location where \fBTcl_GetStringFromObj\fR will store the length
-of a value's string representation. May be (int *)NULL when not used.
+of a value's string representation. May be (Tcl_Size *)NULL when not used. If it points to a variable which
+type is not \fBTcl_Size\fR, a compiler warning will be generated, in
+order to indicate that when the string is larger than INT_MAX
+this function will panic.
.AP "const char" *string in
Null-terminated string value to append to \fIobjPtr\fR.
.AP Tcl_Size limit in
diff --git a/generic/tclDate.c b/generic/tclDate.c
index 15367bf..78e65b9 100644
--- a/generic/tclDate.c
+++ b/generic/tclDate.c
@@ -64,7 +64,6 @@
#define yylex TclDatelex
#define yyerror TclDateerror
#define yydebug TclDatedebug
-#define yynerrs TclDatenerrs
/* Copy the first part of user declarations. */
@@ -1294,9 +1293,6 @@ static YYLTYPE yyloc_default
;
YYLTYPE yylloc = yyloc_default;
- /* Number of syntax errors so far. */
- int yynerrs;
-
int yystate;
/* Number of tokens to shift before error messages enabled. */
int yyerrstatus;
@@ -1360,7 +1356,6 @@ YYLTYPE yylloc = yyloc_default;
yystate = 0;
yyerrstatus = 0;
- yynerrs = 0;
yychar = YYEMPTY; /* Cause a token to be read. */
yylsp[0] = yylloc;
goto yysetstate;
@@ -2098,7 +2093,6 @@ yyerrlab:
/* If not already recovering from an error, report this error. */
if (!yyerrstatus)
{
- ++yynerrs;
#if ! YYERROR_VERBOSE
yyerror (&yylloc, info, YY_("syntax error"));
#else
diff --git a/generic/tclDecls.h b/generic/tclDecls.h
index 3f7ae91..a0953e7 100644
--- a/generic/tclDecls.h
+++ b/generic/tclDecls.h
@@ -4239,25 +4239,25 @@ extern const TclStubs *tclStubsPtr;
# define Tcl_GetUnicodeFromObj(objPtr, sizePtr) (sizeof(*(sizePtr)) <= sizeof(int) ? \
TclGetUnicodeFromObj((objPtr), (sizePtr)) : \
(Tcl_GetUnicodeFromObj)((objPtr), (sizePtr)))
-# define Tcl_ListObjGetElements(interp, listPtr, objcPtr, objvPtr) (sizeof(*(objcPtr)) == sizeof(int) ? \
+# define Tcl_ListObjGetElements(interp, listPtr, objcPtr, objvPtr) (sizeof(*(objcPtr)) <= sizeof(int) ? \
TclListObjGetElements((interp), (listPtr), (objcPtr), (objvPtr)) : \
(Tcl_ListObjGetElements)((interp), (listPtr), (objcPtr), (objvPtr)))
-# define Tcl_ListObjLength(interp, listPtr, lengthPtr) (sizeof(*(lengthPtr)) == sizeof(int) ? \
+# define Tcl_ListObjLength(interp, listPtr, lengthPtr) (sizeof(*(lengthPtr)) <= sizeof(int) ? \
TclListObjLength((interp), (listPtr), (lengthPtr)) : \
(Tcl_ListObjLength)((interp), (listPtr), (lengthPtr)))
-# define Tcl_DictObjSize(interp, dictPtr, sizePtr) (sizeof(*(sizePtr)) == sizeof(int) ? \
+# define Tcl_DictObjSize(interp, dictPtr, sizePtr) (sizeof(*(sizePtr)) <= sizeof(int) ? \
TclDictObjSize((interp), (dictPtr), (sizePtr)) : \
(Tcl_DictObjSize)((interp), (dictPtr), (sizePtr)))
-# define Tcl_SplitList(interp, listStr, argcPtr, argvPtr) (sizeof(*(argcPtr)) == sizeof(int) ? \
+# define Tcl_SplitList(interp, listStr, argcPtr, argvPtr) (sizeof(*(argcPtr)) <= sizeof(int) ? \
TclSplitList((interp), (listStr), (argcPtr), (argvPtr)) : \
(Tcl_SplitList)((interp), (listStr), (argcPtr), (argvPtr)))
-# define Tcl_SplitPath(path, argcPtr, argvPtr) (sizeof(*(argcPtr)) == sizeof(int) ? \
+# define Tcl_SplitPath(path, argcPtr, argvPtr) (sizeof(*(argcPtr)) <= sizeof(int) ? \
TclSplitPath((path), (argcPtr), (argvPtr)) : \
(Tcl_SplitPath)((path), (argcPtr), (argvPtr)))
-# define Tcl_FSSplitPath(pathPtr, lenPtr) (sizeof(*(lenPtr)) == sizeof(int) ? \
+# define Tcl_FSSplitPath(pathPtr, lenPtr) (sizeof(*(lenPtr)) <= sizeof(int) ? \
TclFSSplitPath((pathPtr), (lenPtr)) : \
(Tcl_FSSplitPath)((pathPtr), (lenPtr)))
-# define Tcl_ParseArgsObjv(interp, argTable, objcPtr, objv, remObjv) (sizeof(*(objcPtr)) == sizeof(int) ? \
+# define Tcl_ParseArgsObjv(interp, argTable, objcPtr, objv, remObjv) (sizeof(*(objcPtr)) <= sizeof(int) ? \
TclParseArgsObjv((interp), (argTable), (objcPtr), (objv), (remObjv)) : \
(Tcl_ParseArgsObjv)((interp), (argTable), (objcPtr), (objv), (remObjv)))
# elif !defined(BUILD_tcl)
@@ -4273,25 +4273,25 @@ extern const TclStubs *tclStubsPtr;
# define Tcl_GetUnicodeFromObj(objPtr, sizePtr) (sizeof(*(sizePtr)) <= sizeof(int) ? \
tclStubsPtr->tclGetUnicodeFromObj((objPtr), (sizePtr)) : \
tclStubsPtr->tcl_GetUnicodeFromObj((objPtr), (sizePtr)))
-# define Tcl_ListObjGetElements(interp, listPtr, objcPtr, objvPtr) (sizeof(*(objcPtr)) == sizeof(int) ? \
+# define Tcl_ListObjGetElements(interp, listPtr, objcPtr, objvPtr) (sizeof(*(objcPtr)) <= sizeof(int) ? \
tclStubsPtr->tclListObjGetElements((interp), (listPtr), (objcPtr), (objvPtr)) : \
tclStubsPtr->tcl_ListObjGetElements((interp), (listPtr), (objcPtr), (objvPtr)))
-# define Tcl_ListObjLength(interp, listPtr, lengthPtr) (sizeof(*(lengthPtr)) == sizeof(int) ? \
+# define Tcl_ListObjLength(interp, listPtr, lengthPtr) (sizeof(*(lengthPtr)) <= sizeof(int) ? \
tclStubsPtr->tclListObjLength((interp), (listPtr), (lengthPtr)) : \
tclStubsPtr->tcl_ListObjLength((interp), (listPtr), (lengthPtr)))
-# define Tcl_DictObjSize(interp, dictPtr, sizePtr) (sizeof(*(sizePtr)) == sizeof(int) ? \
+# define Tcl_DictObjSize(interp, dictPtr, sizePtr) (sizeof(*(sizePtr)) <= sizeof(int) ? \
tclStubsPtr->tclDictObjSize((interp), (dictPtr), (sizePtr)) : \
tclStubsPtr->tcl_DictObjSize((interp), (dictPtr), (sizePtr)))
-# define Tcl_SplitList(interp, listStr, argcPtr, argvPtr) (sizeof(*(argcPtr)) == sizeof(int) ? \
+# define Tcl_SplitList(interp, listStr, argcPtr, argvPtr) (sizeof(*(argcPtr)) <= sizeof(int) ? \
tclStubsPtr->tclSplitList((interp), (listStr), (argcPtr), (argvPtr)) : \
tclStubsPtr->tcl_SplitList((interp), (listStr), (argcPtr), (argvPtr)))
-# define Tcl_SplitPath(path, argcPtr, argvPtr) (sizeof(*(argcPtr)) == sizeof(int) ? \
+# define Tcl_SplitPath(path, argcPtr, argvPtr) (sizeof(*(argcPtr)) <= sizeof(int) ? \
tclStubsPtr->tclSplitPath((path), (argcPtr), (argvPtr)) : \
tclStubsPtr->tcl_SplitPath((path), (argcPtr), (argvPtr)))
-# define Tcl_FSSplitPath(pathPtr, lenPtr) (sizeof(*(lenPtr)) == sizeof(int) ? \
+# define Tcl_FSSplitPath(pathPtr, lenPtr) (sizeof(*(lenPtr)) <= sizeof(int) ? \
tclStubsPtr->tclFSSplitPath((pathPtr), (lenPtr)) : \
tclStubsPtr->tcl_FSSplitPath((pathPtr), (lenPtr)))
-# define Tcl_ParseArgsObjv(interp, argTable, objcPtr, objv, remObjv) (sizeof(*(objcPtr)) == sizeof(int) ? \
+# define Tcl_ParseArgsObjv(interp, argTable, objcPtr, objv, remObjv) (sizeof(*(objcPtr)) <= sizeof(int) ? \
tclStubsPtr->tclParseArgsObjv((interp), (argTable), (objcPtr), (objv), (remObjv)) : \
tclStubsPtr->tcl_ParseArgsObjv((interp), (argTable), (objcPtr), (objv), (remObjv)))
# endif /* defined(USE_TCL_STUBS) */
diff --git a/generic/tclGetDate.y b/generic/tclGetDate.y
index e282c9b..a058f13 100644
--- a/generic/tclGetDate.y
+++ b/generic/tclGetDate.y
@@ -641,7 +641,7 @@ static const TABLE TimezoneTable[] = {
{ "ist", tZONE, -HOUR(11/2) }, /* Indian Standard */
{ "zp6", tZONE, -HOUR( 6) }, /* USSR Zone 5 */
#if 0
- /* For completeness. NST is also Newfoundland Stanard, nad SST is
+ /* For completeness. NST is also Newfoundland Standard, and SST is
* also Swedish Summer. */
{ "nst", tZONE, -HOUR(13/2) }, /* North Sumatra */
{ "sst", tZONE, -HOUR( 7) }, /* South Sumatra, USSR Zone 6 */
@@ -1098,7 +1098,7 @@ TclClockOldscanObjCmd(
}
Tcl_ListObjAppendElement(interp, result, resultElement);
- TcNewObj(resultElement);
+ TclNewObj(resultElement);
if (yyHaveDay && !yyHaveDate) {
Tcl_ListObjAppendElement(interp, resultElement,
Tcl_NewIntObj(yyDayOrdinal));
diff --git a/unix/Makefile.in b/unix/Makefile.in
index 83728bd..95a2b58 100644
--- a/unix/Makefile.in
+++ b/unix/Makefile.in
@@ -2125,6 +2125,8 @@ dist-packages: configure-packages
# the name of the .y file so that make doesn't try to automatically regenerate
# the .c file.
+#
+# Remark: see [54a305cb88]. tclDate.c is manually edited, removing the unused "yynerrs" variable
gendate:
bison --output-file=$(GENERIC_DIR)/tclDate.c \
--no-lines \