From 0657f97bc5e5f5b835c2c60713f306fb97950a89 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Thu, 25 May 2023 15:10:55 +0000 Subject: Eliminate some clang warnings. Only use "testbigdata" if sizeof(Tcl_Size) == sizeof(Tcl_WideInt) --- generic/tclTest.c | 7 +++++++ generic/tclTestObj.c | 6 ++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/generic/tclTest.c b/generic/tclTest.c index ec2f4a3..f0dd5bc 100644 --- a/generic/tclTest.c +++ b/generic/tclTest.c @@ -5761,6 +5761,9 @@ TestbytestringObjCmd( #if !defined(TCL_NO_DEPRECATED) # if defined(_MSC_VER) && !defined(NDEBUG) # pragma warning(disable:4133) +# elif defined(__clang__) +# pragma clang diagnostic push +# pragma clang diagnostic ignored "-Wincompatible-pointer-types" # endif int n; /* On purpose, not Tcl_Size, in order to demonstrate what happens */ #else @@ -5779,6 +5782,10 @@ TestbytestringObjCmd( if (p == NULL) { return TCL_ERROR; } +#if !defined(TCL_NO_DEPRECATED) && defined(__clang__) +# pragma clang diagnostic pop +#endif + if (x.m != 1) { Tcl_AppendResult(interp, "Tcl_GetBytesFromObj() overwrites variable", NULL); return TCL_ERROR; diff --git a/generic/tclTestObj.c b/generic/tclTestObj.c index 14c7c70..6ad45e9 100644 --- a/generic/tclTestObj.c +++ b/generic/tclTestObj.c @@ -119,8 +119,10 @@ TclObjTest_Init( Tcl_CreateObjCommand(interp, "testobj", TestobjCmd, NULL, NULL); Tcl_CreateObjCommand(interp, "teststringobj", TeststringobjCmd, NULL, NULL); - Tcl_CreateObjCommand(interp, "testbigdata", TestbigdataCmd, - NULL, NULL); + if (sizeof(Tcl_Size) == sizeof(Tcl_WideInt)) { + Tcl_CreateObjCommand(interp, "testbigdata", TestbigdataCmd, + NULL, NULL); + } return TCL_OK; } -- cgit v0.12