diff options
| author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2023-12-05 09:52:36 (GMT) |
|---|---|---|
| committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2023-12-05 09:52:36 (GMT) |
| commit | ec111e454d8d0c27ae09daa327636732a5c35164 (patch) | |
| tree | f2bc0f38ac14521f067e06dd1d892d28f60e080a | |
| parent | ed29b5d285c3c2ce9276568a62e0ac30bcd4e405 (diff) | |
| parent | bcd1b60f83b72d5be224321218164a8988d8a201 (diff) | |
| download | tcl-ec111e454d8d0c27ae09daa327636732a5c35164.zip tcl-ec111e454d8d0c27ae09daa327636732a5c35164.tar.gz tcl-ec111e454d8d0c27ae09daa327636732a5c35164.tar.bz2 | |
TIP #661 implementation: Disable the Tcl 8 compatibility macros in Tcl 9 by default. Revert TIP #664
| -rw-r--r-- | doc/ByteArrObj.3 | 8 | ||||
| -rw-r--r-- | doc/DictObj.3 | 11 | ||||
| -rw-r--r-- | doc/FileSystem.3 | 11 | ||||
| -rw-r--r-- | doc/ListObj.3 | 22 | ||||
| -rw-r--r-- | doc/ParseArgs.3 | 11 | ||||
| -rw-r--r-- | doc/SplitList.3 | 11 | ||||
| -rw-r--r-- | doc/SplitPath.3 | 11 | ||||
| -rw-r--r-- | doc/StringObj.3 | 10 | ||||
| -rw-r--r-- | generic/tclDecls.h | 50 |
9 files changed, 77 insertions, 68 deletions
diff --git a/doc/ByteArrObj.3 b/doc/ByteArrObj.3 index 70ebe04..5aa541b 100644 --- a/doc/ByteArrObj.3 +++ b/doc/ByteArrObj.3 @@ -46,10 +46,10 @@ 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. 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. +type is not \fBTcl_Size\fR, a compiler warning will be generated. +If your extensions is compiled with -DTCL_8_API, this function will return +NULL if the size of the byte array is larger than INT_MAX (which should +trigger proper error-handling), otherwise expect it to crash. .BE .SH DESCRIPTION .PP diff --git a/doc/DictObj.3 b/doc/DictObj.3 index 8aa4ad1..7469a78 100644 --- a/doc/DictObj.3 +++ b/doc/DictObj.3 @@ -72,11 +72,12 @@ 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. 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. +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. +If your extensions is compiled with -DTCL_8_API, this function will return +NULL if the size of the dictionary is larger than INT_MAX (which should +trigger proper error-handling), otherwise expect it to crash. .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 86a46c7..b8766e7 100644 --- a/doc/FileSystem.3 +++ b/doc/FileSystem.3 @@ -270,11 +270,12 @@ 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 -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. +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. +If your extensions is compiled with -DTCL_8_API, this function will return +NULL if the number of elements is larger than INT_MAX (which should +trigger proper error-handling), otherwise expect it to crash. .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 4445892..220cd08 100644 --- a/doc/ListObj.3 +++ b/doc/ListObj.3 @@ -61,11 +61,12 @@ 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. 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. +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. +If your extensions is compiled with -DTCL_8_API, this function will return +NULL if the list size is larger than INT_MAX (which should +trigger proper error-handling), otherwise expect it to crash. .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. @@ -82,11 +83,12 @@ 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. 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. +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. +If your extensions is compiled with -DTCL_8_API, this function will return +NULL if the list size is larger than INT_MAX (which should +trigger proper error-handling), otherwise expect it to crash. .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 ab3b7d8..ca6f52d 100644 --- a/doc/ParseArgs.3 +++ b/doc/ParseArgs.3 @@ -24,11 +24,12 @@ 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. 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. +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. +If your extensions is compiled with -DTCL_8_API, this function will return +NULL if the number of elements is larger than INT_MAX (which should +trigger proper error-handling), otherwise expect it to crash. .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 2aa5e7c..9f43731 100644 --- a/doc/SplitList.3 +++ b/doc/SplitList.3 @@ -39,11 +39,12 @@ 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. 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. +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. +If your extensions is compiled with -DTCL_8_API, this function will return +NULL if the list size is larger than INT_MAX (which should +trigger proper error-handling), otherwise expect it to crash. .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 54e33da..f55ee3c 100644 --- a/doc/SplitPath.3 +++ b/doc/SplitPath.3 @@ -26,11 +26,12 @@ 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. 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. +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. +If your extensions is compiled with -DTCL_8_API, this function will return +NULL if the number of elements is larger than INT_MAX (which should +trigger proper error-handling), otherwise expect it to crash. .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 0da0e43..305af9a 100644 --- a/doc/StringObj.3 +++ b/doc/StringObj.3 @@ -120,10 +120,12 @@ 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 (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. +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. +If your extensions is compiled with -DTCL_8_API, this function will +panic if the number of elements is larger than INT_MAX (which should +trigger proper error-handling), otherwise expect it to crash. .AP "const char" *string in Null-terminated string value to append to \fIobjPtr\fR. .AP Tcl_Size limit in diff --git a/generic/tclDecls.h b/generic/tclDecls.h index 659058c..13d82a0 100644 --- a/generic/tclDecls.h +++ b/generic/tclDecls.h @@ -4211,7 +4211,7 @@ extern const TclStubs *tclStubsPtr; # undef Tcl_ParseArgsObjv # define Tcl_ParseArgsObjv(interp, argTable, objcPtr, objv, remObjv) \ tclStubsPtr->tclParseArgsObjv((interp), (argTable), (objcPtr), (objv), (remObjv)) -#elif !defined(TCL_NO_DEPRECATED) +#elif defined(TCL_8_API) # undef Tcl_GetByteArrayFromObj # undef Tcl_GetBytesFromObj # undef Tcl_GetStringFromObj @@ -4226,76 +4226,76 @@ extern const TclStubs *tclStubsPtr; # if !defined(USE_TCL_STUBS) # define Tcl_GetByteArrayFromObj(objPtr, sizePtr) (sizeof(*(sizePtr)) <= sizeof(int) ? \ TclGetBytesFromObj(NULL, (objPtr), (sizePtr)) : \ - (Tcl_GetBytesFromObj)(NULL, (objPtr), (sizePtr))) + (Tcl_GetBytesFromObj)(NULL, (objPtr), (Tcl_Size *)(void *)(sizePtr))) # define Tcl_GetBytesFromObj(interp, objPtr, sizePtr) (sizeof(*(sizePtr)) <= sizeof(int) ? \ TclGetBytesFromObj((interp), (objPtr), (sizePtr)) : \ - (Tcl_GetBytesFromObj)((interp), (objPtr), (sizePtr))) + (Tcl_GetBytesFromObj)((interp), (objPtr), (Tcl_Size *)(void *)(sizePtr))) # define Tcl_GetStringFromObj(objPtr, sizePtr) (sizeof(*(sizePtr)) <= sizeof(int) ? \ TclGetStringFromObj((objPtr), (sizePtr)) : \ - (Tcl_GetStringFromObj)((objPtr), (sizePtr))) + (Tcl_GetStringFromObj)((objPtr), (Tcl_Size *)(void *)(sizePtr))) # define Tcl_GetUnicodeFromObj(objPtr, sizePtr) (sizeof(*(sizePtr)) <= sizeof(int) ? \ TclGetUnicodeFromObj((objPtr), (sizePtr)) : \ - (Tcl_GetUnicodeFromObj)((objPtr), (sizePtr))) + (Tcl_GetUnicodeFromObj)((objPtr), (Tcl_Size *)(void *)(sizePtr))) # define Tcl_ListObjGetElements(interp, listPtr, objcPtr, objvPtr) (sizeof(*(objcPtr)) <= sizeof(int) ? \ TclListObjGetElements((interp), (listPtr), (objcPtr), (objvPtr)) : \ - (Tcl_ListObjGetElements)((interp), (listPtr), (objcPtr), (objvPtr))) + (Tcl_ListObjGetElements)((interp), (listPtr), (Tcl_Size *)(void *)(objcPtr), (objvPtr))) # define Tcl_ListObjLength(interp, listPtr, lengthPtr) (sizeof(*(lengthPtr)) <= sizeof(int) ? \ TclListObjLength((interp), (listPtr), (lengthPtr)) : \ - (Tcl_ListObjLength)((interp), (listPtr), (lengthPtr))) + (Tcl_ListObjLength)((interp), (listPtr), (Tcl_Size *)(void *)(lengthPtr))) # define Tcl_DictObjSize(interp, dictPtr, sizePtr) (sizeof(*(sizePtr)) <= sizeof(int) ? \ TclDictObjSize((interp), (dictPtr), (sizePtr)) : \ - (Tcl_DictObjSize)((interp), (dictPtr), (sizePtr))) + (Tcl_DictObjSize)((interp), (dictPtr), (Tcl_Size *)(void *)(sizePtr))) # define Tcl_SplitList(interp, listStr, argcPtr, argvPtr) (sizeof(*(argcPtr)) <= sizeof(int) ? \ TclSplitList((interp), (listStr), (argcPtr), (argvPtr)) : \ - (Tcl_SplitList)((interp), (listStr), (argcPtr), (argvPtr))) + (Tcl_SplitList)((interp), (listStr), (Tcl_Size *)(void *)(argcPtr), (argvPtr))) # define Tcl_SplitPath(path, argcPtr, argvPtr) (sizeof(*(argcPtr)) <= sizeof(int) ? \ TclSplitPath((path), (argcPtr), (argvPtr)) : \ - (Tcl_SplitPath)((path), (argcPtr), (argvPtr))) + (Tcl_SplitPath)((path), (Tcl_Size *)(void *)(argcPtr), (argvPtr))) # define Tcl_FSSplitPath(pathPtr, lenPtr) (sizeof(*(lenPtr)) <= sizeof(int) ? \ TclFSSplitPath((pathPtr), (lenPtr)) : \ - (Tcl_FSSplitPath)((pathPtr), (lenPtr))) + (Tcl_FSSplitPath)((pathPtr), (Tcl_Size *)(void *)(lenPtr))) # 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))) + (Tcl_ParseArgsObjv)((interp), (argTable), (Tcl_Size *)(void *)(objcPtr), (objv), (remObjv))) # elif !defined(BUILD_tcl) # define Tcl_GetByteArrayFromObj(objPtr, sizePtr) (sizeof(*(sizePtr)) <= sizeof(int) ? \ tclStubsPtr->tclGetBytesFromObj(NULL, (objPtr), (sizePtr)) : \ - tclStubsPtr->tcl_GetBytesFromObj(NULL, (objPtr), (sizePtr))) + tclStubsPtr->tcl_GetBytesFromObj(NULL, (objPtr), (Tcl_Size *)(void *)(sizePtr))) # define Tcl_GetBytesFromObj(interp, objPtr, sizePtr) (sizeof(*(sizePtr)) <= sizeof(int) ? \ tclStubsPtr->tclGetBytesFromObj((interp), (objPtr), (sizePtr)) : \ - tclStubsPtr->tcl_GetBytesFromObj((interp), (objPtr), (sizePtr))) + tclStubsPtr->tcl_GetBytesFromObj((interp), (objPtr), (Tcl_Size *)(void *)(sizePtr))) # define Tcl_GetStringFromObj(objPtr, sizePtr) (sizeof(*(sizePtr)) <= sizeof(int) ? \ tclStubsPtr->tclGetStringFromObj((objPtr), (sizePtr)) : \ - tclStubsPtr->tcl_GetStringFromObj((objPtr), (sizePtr))) + tclStubsPtr->tcl_GetStringFromObj((objPtr), (Tcl_Size *)(void *)(sizePtr))) # define Tcl_GetUnicodeFromObj(objPtr, sizePtr) (sizeof(*(sizePtr)) <= sizeof(int) ? \ tclStubsPtr->tclGetUnicodeFromObj((objPtr), (sizePtr)) : \ - tclStubsPtr->tcl_GetUnicodeFromObj((objPtr), (sizePtr))) + tclStubsPtr->tcl_GetUnicodeFromObj((objPtr), (Tcl_Size *)(void *)(sizePtr))) # define Tcl_ListObjGetElements(interp, listPtr, objcPtr, objvPtr) (sizeof(*(objcPtr)) <= sizeof(int) ? \ tclStubsPtr->tclListObjGetElements((interp), (listPtr), (objcPtr), (objvPtr)) : \ - tclStubsPtr->tcl_ListObjGetElements((interp), (listPtr), (objcPtr), (objvPtr))) + tclStubsPtr->tcl_ListObjGetElements((interp), (listPtr), (Tcl_Size *)(void *)(objcPtr), (objvPtr))) # define Tcl_ListObjLength(interp, listPtr, lengthPtr) (sizeof(*(lengthPtr)) <= sizeof(int) ? \ tclStubsPtr->tclListObjLength((interp), (listPtr), (lengthPtr)) : \ - tclStubsPtr->tcl_ListObjLength((interp), (listPtr), (lengthPtr))) + tclStubsPtr->tcl_ListObjLength((interp), (listPtr), (Tcl_Size *)(void *)(lengthPtr))) # define Tcl_DictObjSize(interp, dictPtr, sizePtr) (sizeof(*(sizePtr)) <= sizeof(int) ? \ tclStubsPtr->tclDictObjSize((interp), (dictPtr), (sizePtr)) : \ - tclStubsPtr->tcl_DictObjSize((interp), (dictPtr), (sizePtr))) + tclStubsPtr->tcl_DictObjSize((interp), (dictPtr), (Tcl_Size *)(void *)(sizePtr))) # define Tcl_SplitList(interp, listStr, argcPtr, argvPtr) (sizeof(*(argcPtr)) <= sizeof(int) ? \ tclStubsPtr->tclSplitList((interp), (listStr), (argcPtr), (argvPtr)) : \ - tclStubsPtr->tcl_SplitList((interp), (listStr), (argcPtr), (argvPtr))) + tclStubsPtr->tcl_SplitList((interp), (listStr), (Tcl_Size *)(void *)(argcPtr), (argvPtr))) # define Tcl_SplitPath(path, argcPtr, argvPtr) (sizeof(*(argcPtr)) <= sizeof(int) ? \ tclStubsPtr->tclSplitPath((path), (argcPtr), (argvPtr)) : \ - tclStubsPtr->tcl_SplitPath((path), (argcPtr), (argvPtr))) + tclStubsPtr->tcl_SplitPath((path), (Tcl_Size *)(void *)(argcPtr), (argvPtr))) # define Tcl_FSSplitPath(pathPtr, lenPtr) (sizeof(*(lenPtr)) <= sizeof(int) ? \ tclStubsPtr->tclFSSplitPath((pathPtr), (lenPtr)) : \ - tclStubsPtr->tcl_FSSplitPath((pathPtr), (lenPtr))) + tclStubsPtr->tcl_FSSplitPath((pathPtr), (Tcl_Size *)(void *)(lenPtr))) # 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))) + tclStubsPtr->tcl_ParseArgsObjv((interp), (argTable), (Tcl_Size *)(void *)(objcPtr), (objv), (remObjv))) # endif /* defined(USE_TCL_STUBS) */ -#else /* defined(TCL_NO_DEPRECATED) */ +#else /* !defined(TCL_8_API) */ # undef Tcl_GetByteArrayFromObj # define Tcl_GetByteArrayFromObj(objPtr, sizePtr) \ Tcl_GetBytesFromObj(NULL, (objPtr), (sizePtr)) -#endif /* !defined(TCL_NO_DEPRECATED) */ +#endif /* defined(TCL_8_API) */ #endif /* _TCLDECLS */ |
