From c829651d80705243c9ea3665699f13ad901debbe Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Tue, 22 Mar 2016 09:05:10 +0000 Subject: =?UTF-8?q?Fix=20signed-unsigned-compare=20warning=20(reported=20b?= =?UTF-8?q?y=20Fran=C3=A7ois=20Vogel=20on=20Windows,=20but=20gcc=20can=20t?= =?UTF-8?q?rigger=20it=20as=20well)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- generic/tclCompExpr.c | 2 +- generic/tclEnsemble.c | 2 +- unix/configure | 2 +- unix/tcl.m4 | 2 +- win/configure | 2 +- win/tcl.m4 | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/generic/tclCompExpr.c b/generic/tclCompExpr.c index 50edbec..2ffcc68 100644 --- a/generic/tclCompExpr.c +++ b/generic/tclCompExpr.c @@ -666,7 +666,7 @@ ParseExpr( OpNode *newPtr = NULL; do { - if (size <= UINT_MAX/sizeof(OpNode)) { + if (size <= (int)(UINT_MAX/sizeof(OpNode))) { newPtr = attemptckrealloc(nodes, size * sizeof(OpNode)); } } while ((newPtr == NULL) diff --git a/generic/tclEnsemble.c b/generic/tclEnsemble.c index 986a553..6b6a156 100644 --- a/generic/tclEnsemble.c +++ b/generic/tclEnsemble.c @@ -3081,7 +3081,7 @@ TclAttemptCompileProc( int result, i; Tcl_Token *saveTokenPtr = parsePtr->tokenPtr; int savedStackDepth = envPtr->currStackDepth; - unsigned savedCodeNext = envPtr->codeNext - envPtr->codeStart; + int savedCodeNext = envPtr->codeNext - envPtr->codeStart; int savedAuxDataArrayNext = envPtr->auxDataArrayNext; int savedExceptArrayNext = envPtr->exceptArrayNext; #ifdef TCL_COMPILE_DEBUG diff --git a/unix/configure b/unix/configure index 3f9aa13..e999455 100755 --- a/unix/configure +++ b/unix/configure @@ -4985,7 +4985,7 @@ fi if test "$GCC" = yes; then : CFLAGS_OPTIMIZE=-O2 - CFLAGS_WARNING="-Wall" + CFLAGS_WARNING="-Wall -Wsign-compare -Wdeclaration-after-statement" else diff --git a/unix/tcl.m4 b/unix/tcl.m4 index 57d8ff0..f5aa84e 100644 --- a/unix/tcl.m4 +++ b/unix/tcl.m4 @@ -1096,7 +1096,7 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [ CFLAGS_DEBUG=-g AS_IF([test "$GCC" = yes], [ CFLAGS_OPTIMIZE=-O2 - CFLAGS_WARNING="-Wall" + CFLAGS_WARNING="-Wall -Wsign-compare -Wdeclaration-after-statement" ], [ CFLAGS_OPTIMIZE=-O CFLAGS_WARNING="" diff --git a/win/configure b/win/configure index a1f57d1..73d6d9f 100755 --- a/win/configure +++ b/win/configure @@ -4165,7 +4165,7 @@ $as_echo "using shared flags" >&6; } CFLAGS_DEBUG=-g CFLAGS_OPTIMIZE="-O2 -fomit-frame-pointer" - CFLAGS_WARNING="-Wall -Wdeclaration-after-statement" + CFLAGS_WARNING="-Wall -Wsign-compare -Wdeclaration-after-statement" LDFLAGS_DEBUG= LDFLAGS_OPTIMIZE= diff --git a/win/tcl.m4 b/win/tcl.m4 index a75a936..7eff8e8 100644 --- a/win/tcl.m4 +++ b/win/tcl.m4 @@ -727,7 +727,7 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [ CFLAGS_DEBUG=-g CFLAGS_OPTIMIZE="-O2 -fomit-frame-pointer" - CFLAGS_WARNING="-Wall -Wdeclaration-after-statement" + CFLAGS_WARNING="-Wall -Wsign-compare -Wdeclaration-after-statement" LDFLAGS_DEBUG= LDFLAGS_OPTIMIZE= -- cgit v0.12