From 4a4663b33517db022447636d4653d8a1c88902bf Mon Sep 17 00:00:00 2001 From: Peter da Silva Date: Mon, 24 Apr 2023 09:19:02 -0500 Subject: [PATCH] BCK-7474 Update internal version. (#17) * Update internal version. * Update from gcc-7 to gcc-11 for jammy on linux * Import changes from pull #16 - silencing gcc-11 warnings. * Change %x to %p for formatting pointer --- .github/workflows/linux-ci.yml | 4 ++-- README.md | 2 +- configure | 2 +- configure.in | 2 +- generic/tclXfcntl.c | 6 +++++- generic/tclXhandles.c | 2 +- generic/tclXkeylist.c | 10 ++++++---- generic/tclXsignal.c | 2 +- unix/tclXunixDup.c | 6 ++++-- unix/tclXunixId.c | 20 ++++++++++---------- unix/tclXunixOS.c | 12 +++++++----- 11 files changed, 39 insertions(+), 29 deletions(-) diff --git a/.github/workflows/linux-ci.yml b/.github/workflows/linux-ci.yml index dbca319a..aca2c686 100644 --- a/.github/workflows/linux-ci.yml +++ b/.github/workflows/linux-ci.yml @@ -17,8 +17,8 @@ jobs: run: | sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test sudo apt-get update -qq - sudo apt-get install -y gcc-7 g++-7 - sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 70 --slave /usr/bin/g++ g++ /usr/bin/g++-7 + sudo apt-get install -y gcc-11 g++-11 + sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-11 110 --slave /usr/bin/g++ g++ /usr/bin/g++-11 --slave /usr/bin/gcov gcov /usr/bin/gcov-11 sudo apt-get install -y tcl8.6-dev - name: configure run: | diff --git a/README.md b/README.md index 4720419b..c191780a 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ TclX is upwardly compatible with Tcl. You take the Extended Tcl package, add it Extended Tcl runs on most Unix-like systems and Windows. -While this TclX distribution is tested with Tcl 8.4 and Tk 8.4, it should with Tcl 8.3+. Please check the Extended Tcl homepage at +While this TclX distribution is tested with Tcl 8.6 and Tk 8.4, it should work with Tcl 8.3+. Please check the Extended Tcl homepage at http://tclx.sourceforge.net/ diff --git a/configure b/configure index b9bd8b56..53b3e3a1 100755 --- a/configure +++ b/configure @@ -2342,7 +2342,7 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $ ac_compiler_gnu=$ac_cv_c_compiler_gnu -FULL_VERSION="8.6.0" +FULL_VERSION="8.6.1" # TEA extensions pass this us the version of TEA they think they diff --git a/configure.in b/configure.in index e260419e..2f888380 100755 --- a/configure.in +++ b/configure.in @@ -6,7 +6,7 @@ dnl to configure the system for the local environment. # RCS: @(#) $Id: configure.in,v 1.17 2006/01/26 00:30:54 hobbs Exp $ AC_INIT([tclx], [8.6]) -FULL_VERSION="8.6.0" +FULL_VERSION="8.6.1" TEA_INIT([3.9]) diff --git a/generic/tclXfcntl.c b/generic/tclXfcntl.c index 0da14307..68ffd12f 100644 --- a/generic/tclXfcntl.c +++ b/generic/tclXfcntl.c @@ -200,8 +200,12 @@ GetFcntlAttr (Tcl_Interp *interp, Tcl_Channel channel, int mode, int attrib) value = (optValue == TCLX_BUFFERING_LINE); break; case ATTR_KEEPALIVE: - if (TclXOSgetsockopt (interp, channel, SO_KEEPALIVE, &value) != TCL_OK) + { + socklen_t len; + if (TclXOSgetsockopt (interp, channel, SO_KEEPALIVE, &len) != TCL_OK) return TCL_ERROR; + value = len; + } break; default: Tcl_Panic ("bug in fcntl get attrib"); diff --git a/generic/tclXhandles.c b/generic/tclXhandles.c index 0de292c0..74669c92 100644 --- a/generic/tclXhandles.c +++ b/generic/tclXhandles.c @@ -539,7 +539,7 @@ TclX_HandleFree (void_pt headerPtr, void_pt entryPtr) entryHdrPtr = HEADER_AREA (entryPtr); if (entryHdrPtr->freeLink != ALLOCATED_IDX) - Tcl_Panic ("Tcl_HandleFree: entry not allocated %x\n", entryHdrPtr); + Tcl_Panic ("Tcl_HandleFree: entry not allocated %p\n", entryHdrPtr); entryHdrPtr->freeLink = tblHdrPtr->freeHeadIdx; tblHdrPtr->freeHeadIdx = diff --git a/generic/tclXkeylist.c b/generic/tclXkeylist.c index 3a6f8f20..f8a82e7a 100644 --- a/generic/tclXkeylist.c +++ b/generic/tclXkeylist.c @@ -17,6 +17,7 @@ */ #include "tclExtdInt.h" +#include /* * Keyed lists are stored as arrays recursively defined objects. The data @@ -338,7 +339,7 @@ DeleteKeyedListEntry (keylIntObj_t *keylIntPtr, int entryIdx) if (keylIntPtr->hashTbl != NULL) { Tcl_HashEntry *entryPtr; Tcl_HashSearch search; - int nidx; + intptr_t nidx; entryPtr = Tcl_FindHashEntry(keylIntPtr->hashTbl, keylIntPtr->entries [entryIdx].key); @@ -354,7 +355,7 @@ DeleteKeyedListEntry (keylIntObj_t *keylIntPtr, int entryIdx) */ for (entryPtr = Tcl_FirstHashEntry(keylIntPtr->hashTbl, &search); entryPtr != NULL; entryPtr = Tcl_NextHashEntry(&search)) { - nidx = (int) Tcl_GetHashValue(entryPtr); + nidx = (intptr_t) Tcl_GetHashValue(entryPtr); if (nidx > entryIdx) { Tcl_SetHashValue(entryPtr, (ClientData) (uintptr_t) (nidx - 1)); } @@ -394,7 +395,8 @@ FindKeyedListEntry (keylIntObj_t *keylIntPtr, char **nextSubKeyPtr) { char *keySeparPtr; - int keyLen, findIdx = -1; + int keyLen; + intptr_t findIdx = -1; keySeparPtr = strchr (key, '.'); if (keySeparPtr != NULL) { @@ -416,7 +418,7 @@ FindKeyedListEntry (keylIntObj_t *keylIntPtr, } entryPtr = Tcl_FindHashEntry(keylIntPtr->hashTbl, key); if (entryPtr != NULL) { - findIdx = (int) Tcl_GetHashValue(entryPtr); + findIdx = (intptr_t) Tcl_GetHashValue(entryPtr); } if (keySeparPtr != NULL) { key[keyLen] = tmp; diff --git a/generic/tclXsignal.c b/generic/tclXsignal.c index e163e605..0bb28176 100644 --- a/generic/tclXsignal.c +++ b/generic/tclXsignal.c @@ -463,7 +463,7 @@ SetSignalState (int signalNum, signalProcPtr_t sigFunc, int restart) *----------------------------------------------------------------------------- */ static int -BlockSignals (Tcl_Interp *interp, int action, unsigned char signals[]) +BlockSignals (Tcl_Interp *interp, int action, unsigned char signals[MAXSIG]) { #ifndef NO_SIGACTION int signalNum; diff --git a/unix/tclXunixDup.c b/unix/tclXunixDup.c index 135fb6f4..8d904336 100644 --- a/unix/tclXunixDup.c +++ b/unix/tclXunixDup.c @@ -17,6 +17,7 @@ */ #include "tclExtdInt.h" +#include /*----------------------------------------------------------------------------- @@ -75,7 +76,8 @@ TclXOSDupChannel(Tcl_Interp *interp, Tcl_Channel srcChannel, int mode, char *tar ClientData handle; const Tcl_ChannelType *channelType; Tcl_Channel newChannel = NULL; - int srcFileNum, newFileNum = -1; + intptr_t srcFileNum; + int newFileNum = -1; /* * On Unix, the channels we can dup share the same file for the read and @@ -86,7 +88,7 @@ TclXOSDupChannel(Tcl_Interp *interp, Tcl_Channel srcChannel, int mode, char *tar } else { Tcl_GetChannelHandle (srcChannel, TCL_WRITABLE, &handle); } - srcFileNum = (int) handle; + srcFileNum = (intptr_t) handle; channelType = Tcl_GetChannelType (srcChannel); /* diff --git a/unix/tclXunixId.c b/unix/tclXunixId.c index 8fcf59b3..ed405fa6 100644 --- a/unix/tclXunixId.c +++ b/unix/tclXunixId.c @@ -447,18 +447,18 @@ IdHost (Tcl_Interp *interp, int objc, Tcl_Obj*CONST objv[]) if (objc != 2) return TclX_WrongArgs (interp, objv [0], "host"); - if (gethostname (hostNameBuf, MAXHOSTNAMELEN) < 0) { - TclX_AppendObjResult (interp, Tcl_PosixError (interp), - (char *) NULL); - return TCL_ERROR; - } - hostNameBuf[MAXHOSTNAMELEN-1] = '\0'; - Tcl_SetObjResult (interp, Tcl_NewStringObj (hostNameBuf, -1)); - return TCL_OK; + if (gethostname (hostNameBuf, MAXHOSTNAMELEN) < 0) { + TclX_AppendObjResult (interp, Tcl_PosixError (interp), + (char *) NULL); + return TCL_ERROR; + } + hostNameBuf[MAXHOSTNAMELEN-1] = '\0'; + Tcl_SetObjResult (interp, Tcl_NewStringObj (hostNameBuf, -1)); + return TCL_OK; #else - TclX_AppendObjResult (interp, "host name unavailable on this system ", + TclX_AppendObjResult (interp, "host name unavailable on this system ", "(no gethostname function)", (char *) NULL); - return TCL_ERROR; + return TCL_ERROR; #endif } diff --git a/unix/tclXunixOS.c b/unix/tclXunixOS.c index bcb2e3db..b31e8ee8 100644 --- a/unix/tclXunixOS.c +++ b/unix/tclXunixOS.c @@ -22,6 +22,7 @@ */ #include "tclExtdInt.h" +#include #ifndef NO_GETPRIORITY #include @@ -113,7 +114,7 @@ ChannelToFnum (Tcl_Channel channel, int direction) return -1; } } - return (int) handle; + return (intptr_t) handle; } /*----------------------------------------------------------------------------- @@ -401,7 +402,7 @@ TclXOSsystem (Tcl_Interp *interp, char *command, int *exitCode) if (pid == 0) { close (errPipes [0]); execl ("/bin/sh", "sh", "-c", command, (char *) NULL); - write (errPipes [1], &errno, sizeof (errno)); + if (write (errPipes [1], &errno, sizeof (errno))) {} _exit (127); } @@ -918,8 +919,9 @@ TclXOSgetpeername (Tcl_Interp *interp, Tcl_Channel channel, void *sockaddr, sock int TclXOSgetsockname (Tcl_Interp *interp, Tcl_Channel channel, void *sockaddr, int sockaddrSize) { + socklen_t siz = sockaddrSize; if (getsockname (ChannelToFnum (channel, 0), - (struct sockaddr *) sockaddr, &sockaddrSize) < 0) { + (struct sockaddr *) sockaddr, &siz) < 0) { TclX_AppendObjResult (interp, Tcl_GetChannelName (channel), ": ", Tcl_PosixError (interp), (char *) NULL); return TCL_ERROR; @@ -943,7 +945,7 @@ TclXOSgetsockname (Tcl_Interp *interp, Tcl_Channel channel, void *sockaddr, int int TclXOSgetsockopt (Tcl_Interp *interp, Tcl_Channel channel, int option, socklen_t *valuePtr) { - int valueLen = sizeof (*valuePtr); + socklen_t valueLen = sizeof (*valuePtr); if (getsockopt (ChannelToFnum (channel, 0), SOL_SOCKET, option, (void*) valuePtr, &valueLen) != 0) { @@ -1385,7 +1387,7 @@ TclXOSGetSelectFnum (Tcl_Interp *interp, Tcl_Channel channel, int direction, int (char *) NULL); return TCL_ERROR; } - *fnumPtr = (int) handle; + *fnumPtr = (intptr_t) handle; return TCL_OK; }