From 50b330fbec4f9c2f5aaa93addf7bd016d9e783f3 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Tue, 16 Sep 2025 13:56:22 +0000 Subject: Fix some harmless complier warnings (discovered with clang 20) --- generic/tclTestObj.c | 3 ++- generic/tclUtil.c | 34 +++++++++++++++++----------------- 2 files changed, 19 insertions(+), 18 deletions(-) diff --git a/generic/tclTestObj.c b/generic/tclTestObj.c index f7ea76b..7efdf5a 100644 --- a/generic/tclTestObj.c +++ b/generic/tclTestObj.c @@ -1139,10 +1139,11 @@ TestobjCmd( } Tcl_SetObjResult(interp, Tcl_NewIntObj(varPtr[varIndex]->refCount)); } else if (strcmp(subCmd, "huge") == 0) { + Tcl_Obj *hugeObjPtr; if (objc != 2) { goto wrongNumArgs; } - Tcl_Obj *hugeObjPtr = Tcl_NewObj(); + hugeObjPtr = Tcl_NewObj(); hugeObjPtr->typePtr = &hugeType; hugeObjPtr->length = INT_MAX - 1; hugeObjPtr->bytes = NULL; diff --git a/generic/tclUtil.c b/generic/tclUtil.c index 55c7212..25aa062 100644 --- a/generic/tclUtil.c +++ b/generic/tclUtil.c @@ -152,7 +152,7 @@ const Tcl_ObjType tclEndOffsetType = { * \u000A \n NEWLINE * \u000B \v VERTICAL TAB * \u000C \f FORM FEED - * \u000D \r CARRIAGE RETURN + * \u000D \r CARRIAGE RETURN * \u0020 SPACE * * NOTE: differences between this and other places where Tcl defines a role @@ -270,7 +270,7 @@ const Tcl_ObjType tclEndOffsetType = { * * The command terminating character, * \u003b ; SEMICOLON * must be BRACEd, QUOTEd, or escaped so that it does not terminate the - * command prematurely. + * command prematurely. * * Any of the characters that begin substitutions in scripts, * \u0024 $ DOLLAR * \u005b [ OPEN BRACKET @@ -869,11 +869,11 @@ Tcl_SplitList( size = TclMaxListLength(list, -1, &end) + 1; length = end - list; - if (size >= (INT_MAX/sizeof(char *)) || - length > (INT_MAX - 1 - (size * sizeof(char *)))) { + if (size >= (INT_MAX/(int)sizeof(char *)) + || length > (INT_MAX - 1 - (size * (int)sizeof(char *)))) { if (interp) { - Tcl_SetResult( - interp, "memory allocation limit exceeded", TCL_STATIC); + Tcl_SetResult(interp, + "memory allocation limit exceeded", TCL_STATIC); } return TCL_ERROR; } @@ -1719,7 +1719,7 @@ TclTrimRight( #endif do { pp += pInc; - pInc = TclUtfToUCS4(pp, &ch1); + pInc = TclUtfToUCS4(pp, &ch1); } while (pp + pInc < p); /* @@ -1917,7 +1917,7 @@ Tcl_Concat( */ if (argc == 0) { - result = (char *) ckalloc(1); + result = (char *)ckalloc(1); result[0] = '\0'; return result; } @@ -3610,21 +3610,21 @@ TclFormatInt( * integer([+-]integer)? or end([+-]integer)?. * * Value - * TCL_OK + * TCL_OK * - * The index is stored at the address given by by 'indexPtr'. If - * 'objPtr' has the value "end", the value stored is 'endValue'. + * The index is stored at the address given by by 'indexPtr'. If + * 'objPtr' has the value "end", the value stored is 'endValue'. * - * TCL_ERROR + * TCL_ERROR * - * The value of 'objPtr' does not have one of the expected formats. If - * 'interp' is non-NULL, an error message is left in the interpreter's - * result object. + * The value of 'objPtr' does not have one of the expected formats. If + * 'interp' is non-NULL, an error message is left in the interpreter's + * result object. * * Effect * - * The object referenced by 'objPtr' is converted, as needed, to an - * integer, wide integer, or end-based-index object. + * The object referenced by 'objPtr' is converted, as needed, to an + * integer, wide integer, or end-based-index object. * *---------------------------------------------------------------------- */ -- cgit v0.12 From 58f26a35f709eee5e6d931222c46cc0c486dd471 Mon Sep 17 00:00:00 2001 From: dkf Date: Tue, 16 Sep 2025 14:08:49 +0000 Subject: Indent fix --- generic/tclIcu.c | 6 +++--- generic/tclListObj.c | 6 +++--- generic/tclTest.c | 14 ++++++-------- 3 files changed, 12 insertions(+), 14 deletions(-) diff --git a/generic/tclIcu.c b/generic/tclIcu.c index 6e59b29..a8edbb9 100644 --- a/generic/tclIcu.c +++ b/generic/tclIcu.c @@ -1098,9 +1098,9 @@ IcuConverttoObjCmd( Tcl_GetString(objv[objc-2]), strict, &dsOut) != TCL_OK) { return TCL_ERROR; } - Tcl_SetObjResult(interp, - Tcl_NewByteArrayObj((unsigned char *)Tcl_DStringValue(&dsOut), - Tcl_DStringLength(&dsOut))); + Tcl_SetObjResult(interp, Tcl_NewByteArrayObj( + (unsigned char *)Tcl_DStringValue(&dsOut), + Tcl_DStringLength(&dsOut))); Tcl_DStringFree(&dsOut); return TCL_OK; } diff --git a/generic/tclListObj.c b/generic/tclListObj.c index cb60b00..67e8e03 100644 --- a/generic/tclListObj.c +++ b/generic/tclListObj.c @@ -503,9 +503,9 @@ TclListLimitExceededError( * in Tcl_Size. */ if (interp != NULL) { - Tcl_SetObjResult(interp, - Tcl_ObjPrintf("max length (%" TCL_SIZE_MODIFIER - "d) of a Tcl list exceeded", (Tcl_Size)LIST_MAX)); + Tcl_SetObjResult(interp, Tcl_ObjPrintf( + "max length (%" TCL_SIZE_MODIFIER "d) of a Tcl list exceeded", + (Tcl_Size)LIST_MAX)); Tcl_SetErrorCode(interp, "TCL", "MEMORY", (char *)NULL); } return TCL_ERROR; diff --git a/generic/tclTest.c b/generic/tclTest.c index 703f39e..fce2b80 100644 --- a/generic/tclTest.c +++ b/generic/tclTest.c @@ -9160,8 +9160,7 @@ TestUtfToNormalizedCmd( return TCL_ERROR; } if (len > slen) { - Tcl_SetObjResult(interp, - Tcl_ObjPrintf( + Tcl_SetObjResult(interp, Tcl_ObjPrintf( "Passed length %" TCL_SIZE_MODIFIER "d is greater than string length %" TCL_SIZE_MODIFIER "d.", len, slen)); @@ -9181,8 +9180,8 @@ TestUtfToNormalizedCmd( (Tcl_UnicodeNormalizationForm)normForm, profile, bufPtr, bufLen, &bufStored); if (result == TCL_OK) { /* Return as raw bytes, not string */ - Tcl_SetObjResult(interp, - Tcl_NewByteArrayObj((unsigned char *)bufPtr, bufStored)); + Tcl_SetObjResult(interp, Tcl_NewByteArrayObj( + (unsigned char *)bufPtr, bufStored)); } if (bufPtr != buffer) { Tcl_Free(bufPtr); @@ -9238,8 +9237,7 @@ TestUtfToNormalizedDStringCmd( return TCL_ERROR; } if (len > slen) { - Tcl_SetObjResult(interp, - Tcl_ObjPrintf( + Tcl_SetObjResult(interp, Tcl_ObjPrintf( "Passed length %" TCL_SIZE_MODIFIER "d is greater than string length %" TCL_SIZE_MODIFIER "d.", len, slen)); @@ -9252,8 +9250,8 @@ TestUtfToNormalizedDStringCmd( (Tcl_UnicodeNormalizationForm)normForm, profile, &ds); if (result == TCL_OK) { /* Return as raw bytes, not string */ - Tcl_SetObjResult(interp, - Tcl_NewByteArrayObj((unsigned char *)Tcl_DStringValue(&ds), + Tcl_SetObjResult(interp, Tcl_NewByteArrayObj( + (unsigned char *)Tcl_DStringValue(&ds), Tcl_DStringLength(&ds))); Tcl_DStringFree(&ds); } -- cgit v0.12 From fd75bb9b85ae14cb5358206e0b62a0f0184096b9 Mon Sep 17 00:00:00 2001 From: apnadkarni Date: Tue, 16 Sep 2025 16:43:36 +0000 Subject: Reapply utf8proc patch to Unicode 17 update needed to fix -Wc++-compat warnings. C++ treatment of enums differs from C! --- utf8proc/utf8proc.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/utf8proc/utf8proc.h b/utf8proc/utf8proc.h index 59e5389..86a9a27 100644 --- a/utf8proc/utf8proc.h +++ b/utf8proc/utf8proc.h @@ -209,7 +209,8 @@ typedef enum { * Strip unassigned codepoints. */ UTF8PROC_STRIPNA = (1<<14), -} utf8proc_option_t; +} utf8proc_option_e; +typedef int utf8proc_option_t; /** @name Error codes * Error codes being returned by almost all functions. -- cgit v0.12 From 13d49cff5e749a393d9f04dd098e83567786a124 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Tue, 16 Sep 2025 19:17:09 +0000 Subject: Eliminate __stdcall usage: cygwin32 is no longer supported --- unix/tclUnixInit.c | 17 +++++++---------- unix/tclUnixNotfy.c | 32 ++++++++++++++++---------------- unix/tclUnixPort.h | 25 +++++++++---------------- 3 files changed, 32 insertions(+), 42 deletions(-) diff --git a/unix/tclUnixInit.c b/unix/tclUnixInit.c index c7b2efe..c7de6a8 100644 --- a/unix/tclUnixInit.c +++ b/unix/tclUnixInit.c @@ -36,14 +36,11 @@ #ifdef __cplusplus extern "C" { #endif -#ifdef __clang__ -#pragma clang diagnostic ignored "-Wignored-attributes" -#endif -DLLIMPORT extern __stdcall unsigned char GetVersionExW(void *); -DLLIMPORT extern __stdcall void *GetModuleHandleW(const void *); -DLLIMPORT extern __stdcall void FreeLibrary(void *); -DLLIMPORT extern __stdcall void *GetProcAddress(void *, const char *); -DLLIMPORT extern __stdcall void GetSystemInfo(void *); +DLLIMPORT extern unsigned char GetVersionExW(void *); +DLLIMPORT extern void *GetModuleHandleW(const void *); +DLLIMPORT extern void FreeLibrary(void *); +DLLIMPORT extern void *GetProcAddress(void *, const char *); +DLLIMPORT extern void GetSystemInfo(void *); #ifdef __cplusplus } #endif @@ -877,8 +874,8 @@ TclpSetVariables( unameOK = 1; if (!osInfoInitialized) { void *handle = GetModuleHandleW(L"NTDLL"); - int(__stdcall *getversion)(void *) = - (int(__stdcall *)(void *))GetProcAddress(handle, "RtlGetVersion"); + int(*getversion)(void *) = + (int(*)(void *))GetProcAddress(handle, "RtlGetVersion"); osInfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFOW); if (!getversion || getversion(&osInfo)) { GetVersionExW(&osInfo); diff --git a/unix/tclUnixNotfy.c b/unix/tclUnixNotfy.c index 0bee2f1..1d0b6b0 100644 --- a/unix/tclUnixNotfy.c +++ b/unix/tclUnixNotfy.c @@ -236,31 +236,31 @@ typedef struct { const void *lpszClassName; } WNDCLASSW; -extern void __stdcall CloseHandle(void *); -extern void *__stdcall CreateEventW(void *, unsigned char, unsigned char, +extern void CloseHandle(void *); +extern void * CreateEventW(void *, unsigned char, unsigned char, void *); -extern void * __stdcall CreateWindowExW(void *, const void *, const void *, +extern void * CreateWindowExW(void *, const void *, const void *, unsigned int, int, int, int, int, void *, void *, void *, void *); -extern unsigned int __stdcall DefWindowProcW(void *, int, void *, void *); -extern unsigned char __stdcall DestroyWindow(void *); -extern int __stdcall DispatchMessageW(const MSG *); -extern unsigned char __stdcall GetMessageW(MSG *, void *, int, int); -extern void __stdcall MsgWaitForMultipleObjects(unsigned int, void *, +extern unsigned int DefWindowProcW(void *, int, void *, void *); +extern unsigned char DestroyWindow(void *); +extern int DispatchMessageW(const MSG *); +extern unsigned char GetMessageW(MSG *, void *, int, int); +extern void MsgWaitForMultipleObjects(unsigned int, void *, unsigned char, unsigned int, unsigned int); -extern unsigned char __stdcall PeekMessageW(MSG *, void *, int, int, int); -extern unsigned char __stdcall PostMessageW(void *, unsigned int, void *, +extern unsigned char PeekMessageW(MSG *, void *, int, int, int); +extern unsigned char PostMessageW(void *, unsigned int, void *, void *); -extern void __stdcall PostQuitMessage(int); -extern void *__stdcall RegisterClassW(const WNDCLASSW *); -extern unsigned char __stdcall ResetEvent(void *); -extern unsigned char __stdcall TranslateMessage(const MSG *); +extern void PostQuitMessage(int); +extern void * RegisterClassW(const WNDCLASSW *); +extern unsigned char ResetEvent(void *); +extern unsigned char TranslateMessage(const MSG *); /* * Threaded-cygwin specific constants and functions in this file: */ static const wchar_t *NotfyClassName = L"TclNotifier"; -static unsigned int __stdcall NotifierProc(void *hwnd, unsigned int message, +static unsigned int NotifierProc(void *hwnd, unsigned int message, void *wParam, void *lParam); #endif /* TCL_THREADS && __CYGWIN__ */ @@ -814,7 +814,7 @@ FileHandlerEventProc( #if defined(TCL_THREADS) && defined(__CYGWIN__) -static unsigned int __stdcall +static unsigned int NotifierProc( void *hwnd, unsigned int message, diff --git a/unix/tclUnixPort.h b/unix/tclUnixPort.h index 486fa23..4ca461c 100644 --- a/unix/tclUnixPort.h +++ b/unix/tclUnixPort.h @@ -98,25 +98,18 @@ extern "C" { # define SOCKET unsigned int # define WSAEWOULDBLOCK 10035 typedef unsigned short WCHAR; -#ifdef __clang__ -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wignored-attributes" -#endif - __declspec(dllimport) extern __stdcall int GetModuleHandleExW(unsigned int, const void *, void *); - __declspec(dllimport) extern __stdcall int GetModuleFileNameW(void *, const void *, int); - __declspec(dllimport) extern __stdcall int WideCharToMultiByte(int, int, const void *, int, + __declspec(dllimport) extern int GetModuleHandleExW(unsigned int, const void *, void *); + __declspec(dllimport) extern int GetModuleFileNameW(void *, const void *, int); + __declspec(dllimport) extern int WideCharToMultiByte(int, int, const void *, int, char *, int, const char *, void *); - __declspec(dllimport) extern __stdcall int MultiByteToWideChar(int, int, const char *, int, + __declspec(dllimport) extern int MultiByteToWideChar(int, int, const char *, int, WCHAR *, int); - __declspec(dllimport) extern __stdcall void OutputDebugStringW(const WCHAR *); - __declspec(dllimport) extern __stdcall int IsDebuggerPresent(void); - __declspec(dllimport) extern __stdcall int GetLastError(void); - __declspec(dllimport) extern __stdcall int GetFileAttributesW(const WCHAR *); - __declspec(dllimport) extern __stdcall int SetFileAttributesW(const WCHAR *, int); + __declspec(dllimport) extern void OutputDebugStringW(const WCHAR *); + __declspec(dllimport) extern int IsDebuggerPresent(void); + __declspec(dllimport) extern int GetLastError(void); + __declspec(dllimport) extern int GetFileAttributesW(const WCHAR *); + __declspec(dllimport) extern int SetFileAttributesW(const WCHAR *, int); __declspec(dllimport) extern int cygwin_conv_path(int, const void *, void *, int); -#ifdef __clang__ -#pragma clang diagnostic pop -#endif # define timezone _timezone extern int TclOSstat(const char *name, void *statBuf); extern int TclOSlstat(const char *name, void *statBuf); -- cgit v0.12