diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2020-10-08 13:33:11 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2020-10-08 13:33:11 (GMT) |
commit | 7bf5af5c220c94675e6cbacf175b2bac28df1432 (patch) | |
tree | ab99b02159e20db1cf5de012c85b0dd32d5ec807 | |
parent | 92bd8b3a3f380903aa8f6e7221c2d4aba012a88a (diff) | |
parent | 4a3369807be6e501ec6452edf99a73514c24d861 (diff) | |
download | tcl-7bf5af5c220c94675e6cbacf175b2bac28df1432.zip tcl-7bf5af5c220c94675e6cbacf175b2bac28df1432.tar.gz tcl-7bf5af5c220c94675e6cbacf175b2bac28df1432.tar.bz2 |
Make everything compile warning-free with -Wundef. Put enum ASSEM_DICT_GET_DEF last in TalInstType, so it's binary compatible with Tcl 8.6
-rw-r--r-- | generic/tclAlloc.c | 2 | ||||
-rw-r--r-- | generic/tclAssembly.c | 10 | ||||
-rw-r--r-- | generic/tclCkalloc.c | 2 | ||||
-rw-r--r-- | generic/tclEvent.c | 2 | ||||
-rw-r--r-- | generic/tclObj.c | 2 | ||||
-rwxr-xr-x | unix/configure | 2 | ||||
-rw-r--r-- | unix/tcl.m4 | 2 | ||||
-rwxr-xr-x | win/configure | 2 | ||||
-rw-r--r-- | win/tcl.m4 | 2 | ||||
-rw-r--r-- | win/tclWinPort.h | 6 |
10 files changed, 16 insertions, 16 deletions
diff --git a/generic/tclAlloc.c b/generic/tclAlloc.c index bc4716d..4a84255 100644 --- a/generic/tclAlloc.c +++ b/generic/tclAlloc.c @@ -24,7 +24,7 @@ #include "tclInt.h" #if !TCL_THREADS || !defined(USE_THREAD_ALLOC) -#if USE_TCLALLOC +#if defined(USE_TCLALLOC) && USE_TCLALLOC /* * We should really make use of AC_CHECK_TYPE(caddr_t) here, but it can wait diff --git a/generic/tclAssembly.c b/generic/tclAssembly.c index 2102e84..55fde66 100644 --- a/generic/tclAssembly.c +++ b/generic/tclAssembly.c @@ -131,7 +131,7 @@ enum BasicBlockFlags { * Source instruction type recognized by the assembler. */ -typedef enum TalInstType { +typedef enum { ASSEM_1BYTE, /* Fixed arity, 1-byte instruction */ ASSEM_BEGIN_CATCH, /* Begin catch: one 4-byte jump offset to be * converted to appropriate exception @@ -145,8 +145,6 @@ typedef enum TalInstType { * 1 */ ASSEM_DICT_GET, /* 'dict get' and related - consumes N+1 * operands, produces 1, N > 0 */ - ASSEM_DICT_GET_DEF, /* 'dict getwithdefault' - consumes N+2 - * operands, produces 1, N > 0 */ ASSEM_DICT_SET, /* specifies key count and LVT index, consumes * N+1 operands, produces 1, N > 0 */ ASSEM_DICT_UNSET, /* specifies key count and LVT index, consumes @@ -189,8 +187,10 @@ typedef enum TalInstType { * produces N */ ASSEM_SINT1, /* One 1-byte signed-integer operand * (INCR_STK_IMM) */ - ASSEM_SINT4_LVT4 /* Signed 4-byte integer operand followed by + ASSEM_SINT4_LVT4, /* Signed 4-byte integer operand followed by * LVT entry. Fixed arity */ + ASSEM_DICT_GET_DEF /* 'dict getwithdefault' - consumes N+2 + * operands, produces 1, N > 0 */ } TalInstType; /* @@ -1266,7 +1266,7 @@ AssembleOneLine( Tcl_Obj* instNameObj; /* Name of the instruction */ int tblIdx; /* Index in TalInstructionTable of the * instruction */ - enum TalInstType instType; /* Type of the instruction */ + TalInstType instType; /* Type of the instruction */ Tcl_Obj* operand1Obj = NULL; /* First operand to the instruction */ const char* operand1; /* String rep of the operand */ diff --git a/generic/tclCkalloc.c b/generic/tclCkalloc.c index c1a585e..f761521 100644 --- a/generic/tclCkalloc.c +++ b/generic/tclCkalloc.c @@ -1288,7 +1288,7 @@ TclFinalizeMemorySubsystem(void) Tcl_MutexUnlock(ckallocMutexPtr); #endif -#if USE_TCLALLOC +#if defined(USE_TCLALLOC) && USE_TCLALLOC TclFinalizeAllocSubsystem(); #endif } diff --git a/generic/tclEvent.c b/generic/tclEvent.c index 85f76e3..76a45ae 100644 --- a/generic/tclEvent.c +++ b/generic/tclEvent.c @@ -1048,7 +1048,7 @@ Tcl_InitSubsystems(void) TclInitThreadStorage(); /* Creates hash table for * thread local storage */ -#if USE_TCLALLOC +#if defined(USE_TCLALLOC) && USE_TCLALLOC TclInitAlloc(); /* Process wide mutex init */ #endif #if TCL_THREADS && defined(USE_THREAD_ALLOC) diff --git a/generic/tclObj.c b/generic/tclObj.c index e58206b..6e17141 100644 --- a/generic/tclObj.c +++ b/generic/tclObj.c @@ -161,7 +161,7 @@ typedef struct PendingObjData { static PendingObjData pendingObjData; #define ObjInitDeletionContext(contextPtr) \ PendingObjData *const contextPtr = &pendingObjData -#elif HAVE_FAST_TSD +#elif defined(HAVE_FAST_TSD) static __thread PendingObjData pendingObjData; #define ObjInitDeletionContext(contextPtr) \ PendingObjData *const contextPtr = &pendingObjData diff --git a/unix/configure b/unix/configure index e7f8184..60d60cb 100755 --- a/unix/configure +++ b/unix/configure @@ -5036,7 +5036,7 @@ fi if test "$GCC" = yes; then : CFLAGS_OPTIMIZE=-O2 - CFLAGS_WARNING="-Wall -Wextra -Wshadow -Wwrite-strings -Wpointer-arith" + CFLAGS_WARNING="-Wall -Wextra -Wshadow -Wundef -Wwrite-strings -Wpointer-arith" case "${CC}" in *++|*++-*) ;; diff --git a/unix/tcl.m4 b/unix/tcl.m4 index 2cad8fd..8ee17e1 100644 --- a/unix/tcl.m4 +++ b/unix/tcl.m4 @@ -966,7 +966,7 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [ CFLAGS_DEBUG=-g AS_IF([test "$GCC" = yes], [ CFLAGS_OPTIMIZE=-O2 - CFLAGS_WARNING="-Wall -Wextra -Wshadow -Wwrite-strings -Wpointer-arith" + CFLAGS_WARNING="-Wall -Wextra -Wshadow -Wundef -Wwrite-strings -Wpointer-arith" case "${CC}" in *++|*++-*) ;; diff --git a/win/configure b/win/configure index 7ad386c..d824244 100755 --- a/win/configure +++ b/win/configure @@ -4216,7 +4216,7 @@ $as_echo "using shared flags" >&6; } CFLAGS_DEBUG=-g CFLAGS_OPTIMIZE="-O2 -fomit-frame-pointer" - CFLAGS_WARNING="-Wall -Wextra -Wshadow -Wwrite-strings -Wpointer-arith" + CFLAGS_WARNING="-Wall -Wextra -Wshadow -Wundef -Wwrite-strings -Wpointer-arith" LDFLAGS_DEBUG= LDFLAGS_OPTIMIZE= @@ -673,7 +673,7 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [ CFLAGS_DEBUG=-g CFLAGS_OPTIMIZE="-O2 -fomit-frame-pointer" - CFLAGS_WARNING="-Wall -Wextra -Wshadow -Wwrite-strings -Wpointer-arith" + CFLAGS_WARNING="-Wall -Wextra -Wshadow -Wundef -Wwrite-strings -Wpointer-arith" LDFLAGS_DEBUG= LDFLAGS_OPTIMIZE= diff --git a/win/tclWinPort.h b/win/tclWinPort.h index bf4553c..94c8e87 100644 --- a/win/tclWinPort.h +++ b/win/tclWinPort.h @@ -297,7 +297,7 @@ typedef DWORD_PTR * PDWORD_PTR; * defined in header files above. */ -#if TCL_UNION_WAIT +#ifdef TCL_UNION_WAIT # define WAIT_STATUS_TYPE union wait #else # define WAIT_STATUS_TYPE int @@ -439,10 +439,10 @@ typedef DWORD_PTR * PDWORD_PTR; * Define pid_t and uid_t if they're not already defined. */ -#if ! TCL_PID_T +#if !defined(TCL_PID_T) # define pid_t int #endif /* !TCL_PID_T */ -#if ! TCL_UID_T +#if !defined(TCL_UID_T) # define uid_t int #endif /* !TCL_UID_T */ |