From ac2be8e353082ec64280e2c2f429ace57f674d37 Mon Sep 17 00:00:00 2001 From: pooryorick Date: Sat, 4 Jan 2020 17:21:53 +0000 Subject: Add a test for issue [9128866ec8], encoding fails to load --- tests/encoding.test | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tests/encoding.test b/tests/encoding.test index 1c7ee11..21edf79 100644 --- a/tests/encoding.test +++ b/tests/encoding.test @@ -707,6 +707,21 @@ test encoding-27.2 {encoding dirs basic behavior} -returnCodes error -body { } -result "expected directory list but got \"\{not a list\"" } + + +test encoding-28.0 {all encodings load} -body { + set string hello + foreach name [encoding names] { + incr count + encoding convertto $name $string + + # discard the cached internal representation of Tcl_Encoding + # Unfortunately, without this, encoding 2-1 fails. + llength $name + } + return $count +} -result 81 + runtests } -- cgit v0.12 From a75f6ac8ce9148d70852d4a6b749a42af19c6562 Mon Sep 17 00:00:00 2001 From: dgp Date: Sun, 5 Jan 2020 19:03:12 +0000 Subject: Fix documentation, comments, and argument names of Tcl_TransferResult(). --- doc/SetResult.3 | 24 +++++++++++++----------- generic/tcl.decls | 2 +- generic/tclDecls.h | 4 ++-- generic/tclResult.c | 32 +++++++++++++------------------- 4 files changed, 29 insertions(+), 33 deletions(-) diff --git a/doc/SetResult.3 b/doc/SetResult.3 index e5b81d7..ef6cceb 100644 --- a/doc/SetResult.3 +++ b/doc/SetResult.3 @@ -31,7 +31,7 @@ const char * \fBTcl_ResetResult\fR(\fIinterp\fR) .sp .VS 8.6 -\fBTcl_TransferResult\fR(\fIsourceInterp, result, targetInterp\fR) +\fBTcl_TransferResult\fR(\fIsourceInterp, code, targetInterp\fR) .VE 8.6 .sp \fBTcl_AppendElement\fR(\fIinterp, element\fR) @@ -58,16 +58,15 @@ An argument list which must have been initialized using \fBva_start\fR, and cleared using \fBva_end\fR. .AP Tcl_Interp *sourceInterp in .VS 8.6 -Interpreter that the result and error information should be copied from. +Interpreter that the result and return options should be transferred from. .VE 8.6 .AP Tcl_Interp *targetInterp in .VS 8.6 -Interpreter that the result and error information should be copied to. +Interpreter that the result and return options should be transferred to. .VE 8.6 -.AP int result in +.AP int code in .VS 8.6 -If \fBTCL_OK\fR, only copy the result. If \fBTCL_ERROR\fR, copy the error -information as well. +Return code value that controls transfer of return options. .VE 8.6 .BE .SH DESCRIPTION @@ -156,10 +155,12 @@ call; the last argument in the list must be a NULL pointer. instead of taking a variable number of arguments it takes an argument list. .PP .VS 8.6 -\fBTcl_TransferResult\fR moves a result from one interpreter to another, -optionally (dependent on the \fIresult\fR parameter) including the error -information dictionary as well. The interpreters must be in the same thread. -The source interpreter will have its result reset by this operation. +If \fIsourceInterp\fR and \fItargetInterp\fR are the same, this is a no-op. +Otherwise, \fBTcl_TransferResult\fR moves the result from \fIsourceInterp\fR +to \fItargetInterp\fR, and resets the result in \fIsourceInterp\fR. It +also moves the return options dictionary as controlled by the return code +value \fIcode\fR in the same manner as \fBTcl_GetReturnOptions\fR. The two +interpreters must have been created in the same thread. .VE 8.6 .SH "DEPRECATED INTERFACES" .SS "OLD STRING PROCEDURES" @@ -250,6 +251,7 @@ typedef void \fBTcl_FreeProc\fR( When \fIfreeProc\fR is called, its \fIblockPtr\fR will be set to the value of \fIresult\fR passed to \fBTcl_SetResult\fR. .SH "SEE ALSO" -Tcl_AddErrorInfo, Tcl_CreateObjCommand, Tcl_SetErrorCode, Tcl_Interp +Tcl_AddErrorInfo, Tcl_CreateObjCommand, Tcl_SetErrorCode, Tcl_Interp, +Tcl_GetReturnOptions .SH KEYWORDS append, command, element, list, value, result, return value, interpreter diff --git a/generic/tcl.decls b/generic/tcl.decls index c2a9c89..f37c0f6 100644 --- a/generic/tcl.decls +++ b/generic/tcl.decls @@ -2223,7 +2223,7 @@ declare 606 { # TIP#307 (move results between interpreters) dkf declare 607 { - void Tcl_TransferResult(Tcl_Interp *sourceInterp, int result, + void Tcl_TransferResult(Tcl_Interp *sourceInterp, int code, Tcl_Interp *targetInterp) } diff --git a/generic/tclDecls.h b/generic/tclDecls.h index 719cdf3..a49121a 100644 --- a/generic/tclDecls.h +++ b/generic/tclDecls.h @@ -1749,7 +1749,7 @@ EXTERN int Tcl_GetErrorLine(Tcl_Interp *interp); EXTERN void Tcl_SetErrorLine(Tcl_Interp *interp, int lineNum); /* 607 */ EXTERN void Tcl_TransferResult(Tcl_Interp *sourceInterp, - int result, Tcl_Interp *targetInterp); + int code, Tcl_Interp *targetInterp); /* 608 */ EXTERN int Tcl_InterpActive(Tcl_Interp *interp); /* 609 */ @@ -2477,7 +2477,7 @@ typedef struct TclStubs { int (*tcl_ParseArgsObjv) (Tcl_Interp *interp, const Tcl_ArgvInfo *argTable, int *objcPtr, Tcl_Obj *const *objv, Tcl_Obj ***remObjv); /* 604 */ int (*tcl_GetErrorLine) (Tcl_Interp *interp); /* 605 */ void (*tcl_SetErrorLine) (Tcl_Interp *interp, int lineNum); /* 606 */ - void (*tcl_TransferResult) (Tcl_Interp *sourceInterp, int result, Tcl_Interp *targetInterp); /* 607 */ + void (*tcl_TransferResult) (Tcl_Interp *sourceInterp, int code, Tcl_Interp *targetInterp); /* 607 */ int (*tcl_InterpActive) (Tcl_Interp *interp); /* 608 */ void (*tcl_BackgroundException) (Tcl_Interp *interp, int code); /* 609 */ int (*tcl_ZlibDeflate) (Tcl_Interp *interp, int format, Tcl_Obj *data, int level, Tcl_Obj *gzipHeaderDictObj); /* 610 */ diff --git a/generic/tclResult.c b/generic/tclResult.c index 9d0714c..bdb3912 100644 --- a/generic/tclResult.c +++ b/generic/tclResult.c @@ -1682,22 +1682,14 @@ Tcl_SetReturnOptions( * * Tcl_TransferResult -- * - * Copy the result (and error information) from one interp to another. + * Transfer the result (and error information) from one interp to another. * Used when one interp has caused another interp to evaluate a script * and then wants to transfer the results back to itself. * - * This routine copies the string reps of the result and error - * information. It does not simply increment the refcounts of the result - * and error information objects themselves. It is not legal to exchange - * objects between interps, because an object may be kept alive by one - * interp, but have an internal rep that is only valid while some other - * interp is alive. - * * Results: - * The target interp's result is set to a copy of the source interp's - * result. The source's errorInfo field may be transferred to the - * target's errorInfo field, and the source's errorCode field may be - * transferred to the target's errorCode field. + * The result of targetInterp is set to the result read from sourceInterp. + * The return options dictionary of sourceInterp is transferred to + * targetInterp as appropriate for the return code value code. * * Side effects: * None. @@ -1707,14 +1699,16 @@ Tcl_SetReturnOptions( void Tcl_TransferResult( - Tcl_Interp *sourceInterp, /* Interp whose result and error information + Tcl_Interp *sourceInterp, /* Interp whose result and return options * should be moved to the target interp. * After moving result, this interp's result * is reset. */ - int result, /* TCL_OK if just the result should be copied, - * TCL_ERROR if both the result and error - * information should be copied. */ - Tcl_Interp *targetInterp) /* Interp where result and error information + int code, /* The return code value active in + * sourceInterp. Controls how the return options + * dictionary is retrieved from sourceInterp, + * same as in Tcl_GetReturnOptions, to then be + * transferred to targetInterp. */ + Tcl_Interp *targetInterp) /* Interp where result and return options * should be stored. If source and target are * the same, nothing is done. */ { @@ -1725,7 +1719,7 @@ Tcl_TransferResult( return; } - if (result == TCL_OK && siPtr->returnOpts == NULL) { + if (code == TCL_OK && siPtr->returnOpts == NULL) { /* * Special optimization for the common case of normal command return * code and no explicit return options. @@ -1737,7 +1731,7 @@ Tcl_TransferResult( } } else { Tcl_SetReturnOptions(targetInterp, - Tcl_GetReturnOptions(sourceInterp, result)); + Tcl_GetReturnOptions(sourceInterp, code)); tiPtr->flags &= ~(ERR_ALREADY_LOGGED); } Tcl_SetObjResult(targetInterp, Tcl_GetObjResult(sourceInterp)); -- cgit v0.12 From 5f46a6c4a74189937ea3ffee44c7d022a75edf4c Mon Sep 17 00:00:00 2001 From: dgp Date: Sun, 5 Jan 2020 19:16:33 +0000 Subject: Rewrite: lead paragraph with name of documented routine. --- doc/SetResult.3 | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/doc/SetResult.3 b/doc/SetResult.3 index ef6cceb..6cd17ca 100644 --- a/doc/SetResult.3 +++ b/doc/SetResult.3 @@ -155,12 +155,14 @@ call; the last argument in the list must be a NULL pointer. instead of taking a variable number of arguments it takes an argument list. .PP .VS 8.6 -If \fIsourceInterp\fR and \fItargetInterp\fR are the same, this is a no-op. -Otherwise, \fBTcl_TransferResult\fR moves the result from \fIsourceInterp\fR -to \fItargetInterp\fR, and resets the result in \fIsourceInterp\fR. It -also moves the return options dictionary as controlled by the return code -value \fIcode\fR in the same manner as \fBTcl_GetReturnOptions\fR. The two -interpreters must have been created in the same thread. +\fBTcl_TransferResult\fR transfers interpreter state from \fIsourceInterp\fR +to \fItargetInterp\R. The two interpreters must have been created in the +same thread. If \fIsourceInterp\fR and \fItargetInterp\fR are the same, +this is a no-op. Otherwise, \fBTcl_TransferResult\fR moves the result +from \fIsourceInterp\fR to \fItargetInterp\fR, and resets the result +in \fIsourceInterp\fR. It also moves the return options dictionary as +controlled by the return code value \fIcode\fR in the same manner +as \fBTcl_GetReturnOptions\fR. .VE 8.6 .SH "DEPRECATED INTERFACES" .SS "OLD STRING PROCEDURES" -- cgit v0.12 From 3dae54c810e66b88879e0f30a7374e5327815901 Mon Sep 17 00:00:00 2001 From: dgp Date: Sun, 5 Jan 2020 19:18:30 +0000 Subject: formatting typo and rewrite --- doc/SetResult.3 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/SetResult.3 b/doc/SetResult.3 index 6cd17ca..7ced0be 100644 --- a/doc/SetResult.3 +++ b/doc/SetResult.3 @@ -156,9 +156,9 @@ instead of taking a variable number of arguments it takes an argument list. .PP .VS 8.6 \fBTcl_TransferResult\fR transfers interpreter state from \fIsourceInterp\fR -to \fItargetInterp\R. The two interpreters must have been created in the +to \fItargetInterp\fR. The two interpreters must have been created in the same thread. If \fIsourceInterp\fR and \fItargetInterp\fR are the same, -this is a no-op. Otherwise, \fBTcl_TransferResult\fR moves the result +nothing is done. Otherwise, \fBTcl_TransferResult\fR moves the result from \fIsourceInterp\fR to \fItargetInterp\fR, and resets the result in \fIsourceInterp\fR. It also moves the return options dictionary as controlled by the return code value \fIcode\fR in the same manner -- cgit v0.12 From b60f173c379f120a700b92671e10dc780b64acf1 Mon Sep 17 00:00:00 2001 From: dgp Date: Sun, 5 Jan 2020 19:41:04 +0000 Subject: Tcl_TransferResult was new in 8.6, so mark the man page with that version. --- doc/SetResult.3 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/SetResult.3 b/doc/SetResult.3 index 7ced0be..e50650e 100644 --- a/doc/SetResult.3 +++ b/doc/SetResult.3 @@ -5,7 +5,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -.TH Tcl_SetResult 3 8.0 Tcl "Tcl Library Procedures" +.TH Tcl_SetResult 3 8.6 Tcl "Tcl Library Procedures" .so man.macros .BS .SH NAME -- cgit v0.12 From 1ccdd5f18672bc47517b020a1c65d861351fcfdd Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Mon, 6 Jan 2020 10:28:28 +0000 Subject: Don't assume/set LDFLAGS being "", it could be set on the "configure" command-line. Remove "test-packages" test-target (which doesn't exist), but add "test-tcl" being the same as "test". --- unix/Makefile.in | 21 ++++++++++++++++++++- unix/configure | 1 - unix/tcl.m4 | 4 +--- win/Makefile.in | 2 +- 4 files changed, 22 insertions(+), 6 deletions(-) diff --git a/unix/Makefile.in b/unix/Makefile.in index ea89d11..f314862 100644 --- a/unix/Makefile.in +++ b/unix/Makefile.in @@ -601,7 +601,9 @@ tcltest-real: # tcltest, ie: # % make test TESTFLAGS="-verbose bps -file fileName.test" -test: tcltest@EXEEXT@ +test: test-tcl + +test-tcl: tcltest@EXEEXT@ @LD_LIBRARY_PATH_VAR@="`pwd`:$${@LD_LIBRARY_PATH_VAR@}"; export @LD_LIBRARY_PATH_VAR@; \ TCL_LIBRARY="${TCL_BUILDTIME_LIBRARY}"; export TCL_LIBRARY; \ ./tcltest@EXEEXT@ $(TOP_DIR)/tests/all.tcl $(TESTFLAGS) @@ -1862,4 +1864,21 @@ package-generate: rm -rf $(PACKAGE) #-------------------------------------------------------------------------- +# The list of all the targets that do not correspond to real files. This stops +# 'make' from getting confused when someone makes an error in a rule. +#-------------------------------------------------------------------------- + +.PHONY: all binaries libraries objs doc html html-tcl html-tk test runtest +.PHONY: install install-strip install-binaries install-libraries +.PHONY: install-headers install-private-headers install-doc +.PHONY: clean distclean depend genstubs checkstubs checkexports checkuchar +.PHONY: shell gdb valgrind valgrindshell dist alldist rpm +.PHONY: tclLibObjs tcltest-real test-tcl gdb-test ro-test trace-test xttest +.PHONY: topDirName gendate gentommath_h trace-shell checkdoc +.PHONY: install-tzdata install-msgs +.PHONY: packages configure-packages test-packages clean-packages +.PHONY: dist-packages distclean-packages install-packages +.PHONY: install-libraries-zipfs-shared install-libraries-zipfs-static tclzipfile + +#-------------------------------------------------------------------------- # DO NOT DELETE THIS LINE -- make depend depends on it. diff --git a/unix/configure b/unix/configure index 3cfc79f..a84226f 100755 --- a/unix/configure +++ b/unix/configure @@ -7657,7 +7657,6 @@ fi SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" - LDFLAGS="" if test $doRpath = yes; then CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' diff --git a/unix/tcl.m4 b/unix/tcl.m4 index 932b0ad..75608b5 100644 --- a/unix/tcl.m4 +++ b/unix/tcl.m4 @@ -1507,7 +1507,6 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [ # Step 4 will set the necessary variables DL_OBJS="" SHLIB_LD_LIBS="" - LDFLAGS="" ;; *) case "$arch" in @@ -1526,7 +1525,7 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [ CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}']) LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.${SHLIB_VERSION}' - LDFLAGS="-Wl,-export-dynamic" + LDFLAGS="$LDFLAGS -Wl,-export-dynamic" ;; esac case "$arch" in @@ -1576,7 +1575,6 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [ SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" - LDFLAGS="" AS_IF([test $doRpath = yes], [ CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}']) diff --git a/win/Makefile.in b/win/Makefile.in index 768711a..47a754d 100644 --- a/win/Makefile.in +++ b/win/Makefile.in @@ -716,7 +716,7 @@ install-private-headers: libraries # tcltest, i.e.: # % make test TESTFLAGS="-verbose bps -file fileName.test" -test: test-tcl test-packages +test: test-tcl test-tcl: tcltest TCL_LIBRARY="$(LIBRARY_DIR)"; export TCL_LIBRARY; \ -- cgit v0.12