From 96906cee5e0ea778956e526b49b8b0b6c2f8f192 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 2 Aug 2019 12:45:54 +0000 Subject: Add one more knownMsvcBug marker, for a test-case which sometimes fails in Travis. Fix a struct initializer, add two typecasts and a "const", which can generate gcc warnings with some compiler options. --- generic/tclCmdMZ.c | 2 +- generic/tclEnv.c | 3 ++- generic/tclStubLib.c | 2 +- tests/cmdMZ.test | 5 ++++- win/tclWinTime.c | 2 +- 5 files changed, 9 insertions(+), 5 deletions(-) diff --git a/generic/tclCmdMZ.c b/generic/tclCmdMZ.c index 1cb27fc..ae10e74 100644 --- a/generic/tclCmdMZ.c +++ b/generic/tclCmdMZ.c @@ -2720,7 +2720,7 @@ TclStringCmp( int reqlength) /* requested length; -1 to compare whole * strings */ { - char *s1, *s2; + const char *s1, *s2; int empty, length, match, s1len, s2len; memCmpFn_t memCmpFn; diff --git a/generic/tclEnv.c b/generic/tclEnv.c index b001153..da05f93 100644 --- a/generic/tclEnv.c +++ b/generic/tclEnv.c @@ -119,7 +119,8 @@ TclSetupEnv( Tcl_MutexLock(&envMutex); for (i = 0; environ[i] != NULL; i++) { Tcl_Obj *obj1, *obj2; - char *p1, *p2; + const char *p1; + char *p2; p1 = Tcl_ExternalToUtfDString(NULL, environ[i], -1, &envString); p2 = strchr(p1, '='); diff --git a/generic/tclStubLib.c b/generic/tclStubLib.c index 859cbf9..bebea81 100644 --- a/generic/tclStubLib.c +++ b/generic/tclStubLib.c @@ -68,7 +68,7 @@ Tcl_InitStubs( */ if (!stubsPtr || (stubsPtr->magic != TCL_STUB_MAGIC)) { - iPtr->result = "interpreter uses an incompatible stubs mechanism"; + iPtr->result = (char *)"interpreter uses an incompatible stubs mechanism"; iPtr->freeProc = TCL_STATIC; return NULL; } diff --git a/tests/cmdMZ.test b/tests/cmdMZ.test index 5ee2d23..d77629b 100644 --- a/tests/cmdMZ.test +++ b/tests/cmdMZ.test @@ -22,12 +22,15 @@ namespace eval ::tcl::test::cmdMZ { namespace import ::tcltest::makeFile namespace import ::tcltest::removeFile namespace import ::tcltest::temporaryDirectory + namespace import ::tcltest::testConstraint namespace import ::tcltest::test if {[namespace which -command ::tcl::unsupported::timerate] ne ""} { namespace import ::tcl::unsupported::timerate } + testConstraint knownMsvcBug [expr {![info exists ::env(TRAVIS_OS_NAME)] || ![string match windows $::env(TRAVIS_OS_NAME)]}] + proc ListGlobMatch {expected actual} { if {[llength $expected] != [llength $actual]} { return 0 @@ -343,7 +346,7 @@ test cmdMZ-5.4 {Tcl_TimeObjCmd: nothing happens with negative iteration counts} test cmdMZ-5.5 {Tcl_TimeObjCmd: result format} -body { time {format 1} } -match regexp -result {^\d+ microseconds per iteration} -test cmdMZ-5.6 {Tcl_TimeObjCmd: slower commands take longer} { +test cmdMZ-5.6 {Tcl_TimeObjCmd: slower commands take longer} knownMsvcBug { expr {[lindex [time {_nrt_sleep 1}] 0] < [lindex [time {_nrt_sleep 20}] 0]} } 1 test cmdMZ-5.7 {Tcl_TimeObjCmd: errors generate right trace} { diff --git a/win/tclWinTime.c b/win/tclWinTime.c index 77924ee..1fe21a6 100644 --- a/win/tclWinTime.c +++ b/win/tclWinTime.c @@ -122,7 +122,7 @@ static struct { int initialized; /* 1 if initialized, 0 otherwise */ int perfCounter; /* 1 if performance counter usable for wide clicks */ double microsecsScale; /* Denominator scale between clock / microsecs */ -} wideClick = {0, 0.0}; +} wideClick = {0, 0, 0.0}; /* -- cgit v0.12