summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2015-10-08 14:41:46 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2015-10-08 14:41:46 (GMT)
commit404bcc3435d7a5ce178b4b84c86833285d3aa1d4 (patch)
tree6536ed8e4e2b792c8a24b07fe63701c5f7bde8c1
parentdbb3b8800c3ddc4749f02953e684ae4104631be1 (diff)
downloadtcl-404bcc3435d7a5ce178b4b84c86833285d3aa1d4.zip
tcl-404bcc3435d7a5ce178b4b84c86833285d3aa1d4.tar.gz
tcl-404bcc3435d7a5ce178b4b84c86833285d3aa1d4.tar.bz2
Decorate Tcl_Exit() and Tcl_SetExitProc()'s argument with TCL_NORETURN as appropriate, as already done with Tcl_Panic() earlier.
Fix minor msvc compiler warning in tclWinFile.c
-rw-r--r--generic/tcl.decls4
-rw-r--r--generic/tclDecls.h8
-rw-r--r--generic/tclEvent.c8
-rwxr-xr-xwin/tclWinFile.c3
4 files changed, 11 insertions, 12 deletions
diff --git a/generic/tcl.decls b/generic/tcl.decls
index a5cd24d..797a5a7 100644
--- a/generic/tcl.decls
+++ b/generic/tcl.decls
@@ -480,7 +480,7 @@ declare 132 {
void Tcl_EventuallyFree(ClientData clientData, Tcl_FreeProc *freeProc)
}
declare 133 {
- void Tcl_Exit(int status)
+ TCL_NORETURN void Tcl_Exit(int status)
}
declare 134 {
int Tcl_ExposeCommand(Tcl_Interp *interp, const char *hiddenCmdToken,
@@ -1872,7 +1872,7 @@ declare 518 {
# TIP#121 (exit handler) dkf for Joe Mistachkin
declare 519 {
- Tcl_ExitProc *Tcl_SetExitProc(Tcl_ExitProc *proc)
+ Tcl_ExitProc *Tcl_SetExitProc(TCL_NORETURN1 Tcl_ExitProc *proc)
}
# TIP#143 (resource limits) dkf
diff --git a/generic/tclDecls.h b/generic/tclDecls.h
index 996129d..b022d3c 100644
--- a/generic/tclDecls.h
+++ b/generic/tclDecls.h
@@ -417,7 +417,7 @@ EXTERN int Tcl_EvalObj(Tcl_Interp *interp, Tcl_Obj *objPtr);
EXTERN void Tcl_EventuallyFree(ClientData clientData,
Tcl_FreeProc *freeProc);
/* 133 */
-EXTERN void Tcl_Exit(int status);
+EXTERN TCL_NORETURN void Tcl_Exit(int status);
/* 134 */
EXTERN int Tcl_ExposeCommand(Tcl_Interp *interp,
const char *hiddenCmdToken,
@@ -1500,7 +1500,7 @@ EXTERN void Tcl_GetCommandFullName(Tcl_Interp *interp,
EXTERN int Tcl_FSEvalFileEx(Tcl_Interp *interp,
Tcl_Obj *fileName, const char *encodingName);
/* 519 */
-EXTERN Tcl_ExitProc * Tcl_SetExitProc(Tcl_ExitProc *proc);
+EXTERN Tcl_ExitProc * Tcl_SetExitProc(TCL_NORETURN1 Tcl_ExitProc *proc);
/* 520 */
EXTERN void Tcl_LimitAddHandler(Tcl_Interp *interp, int type,
Tcl_LimitHandlerProc *handlerProc,
@@ -1976,7 +1976,7 @@ typedef struct TclStubs {
int (*tcl_EvalFile) (Tcl_Interp *interp, const char *fileName); /* 130 */
int (*tcl_EvalObj) (Tcl_Interp *interp, Tcl_Obj *objPtr); /* 131 */
void (*tcl_EventuallyFree) (ClientData clientData, Tcl_FreeProc *freeProc); /* 132 */
- void (*tcl_Exit) (int status); /* 133 */
+ TCL_NORETURN1 void (*tcl_Exit) (int status); /* 133 */
int (*tcl_ExposeCommand) (Tcl_Interp *interp, const char *hiddenCmdToken, const char *cmdName); /* 134 */
int (*tcl_ExprBoolean) (Tcl_Interp *interp, const char *expr, int *ptr); /* 135 */
int (*tcl_ExprBooleanObj) (Tcl_Interp *interp, Tcl_Obj *objPtr, int *ptr); /* 136 */
@@ -2370,7 +2370,7 @@ typedef struct TclStubs {
Tcl_Command (*tcl_GetCommandFromObj) (Tcl_Interp *interp, Tcl_Obj *objPtr); /* 516 */
void (*tcl_GetCommandFullName) (Tcl_Interp *interp, Tcl_Command command, Tcl_Obj *objPtr); /* 517 */
int (*tcl_FSEvalFileEx) (Tcl_Interp *interp, Tcl_Obj *fileName, const char *encodingName); /* 518 */
- Tcl_ExitProc * (*tcl_SetExitProc) (Tcl_ExitProc *proc); /* 519 */
+ Tcl_ExitProc * (*tcl_SetExitProc) (TCL_NORETURN1 Tcl_ExitProc *proc); /* 519 */
void (*tcl_LimitAddHandler) (Tcl_Interp *interp, int type, Tcl_LimitHandlerProc *handlerProc, ClientData clientData, Tcl_LimitHandlerDeleteProc *deleteProc); /* 520 */
void (*tcl_LimitRemoveHandler) (Tcl_Interp *interp, int type, Tcl_LimitHandlerProc *handlerProc, ClientData clientData); /* 521 */
int (*tcl_LimitReady) (Tcl_Interp *interp); /* 522 */
diff --git a/generic/tclEvent.c b/generic/tclEvent.c
index 281ff6c..8305410 100644
--- a/generic/tclEvent.c
+++ b/generic/tclEvent.c
@@ -89,7 +89,7 @@ static int subsystemsInitialized = 0;
* non-NULL value.
*/
-static Tcl_ExitProc *appExitPtr = NULL;
+static TCL_NORETURN1 Tcl_ExitProc *appExitPtr = NULL;
typedef struct ThreadSpecificData {
ExitHandler *firstExitPtr; /* First in list of all exit handlers for this
@@ -857,7 +857,7 @@ Tcl_DeleteThreadExitHandler(
Tcl_ExitProc *
Tcl_SetExitProc(
- Tcl_ExitProc *proc) /* New exit handler for app or NULL */
+ TCL_NORETURN1 Tcl_ExitProc *proc) /* New exit handler for app or NULL */
{
Tcl_ExitProc *prevExitProc;
@@ -933,12 +933,12 @@ InvokeExitHandlers(void)
*----------------------------------------------------------------------
*/
-void
+TCL_NORETURN void
Tcl_Exit(
int status) /* Exit status for application; typically 0
* for normal return, 1 for error return. */
{
- Tcl_ExitProc *currentAppExitPtr;
+ TCL_NORETURN1 Tcl_ExitProc *currentAppExitPtr;
Tcl_MutexLock(&exitMutex);
currentAppExitPtr = appExitPtr;
diff --git a/win/tclWinFile.c b/win/tclWinFile.c
index be9c947..25c6ea4 100755
--- a/win/tclWinFile.c
+++ b/win/tclWinFile.c
@@ -1467,8 +1467,7 @@ TclpGetUserHome(
* User exists but has no home dir. Return
* "{GetProfilesDirectory}/<user>".
*/
- DWORD size = MAX_PATH;
- int i;
+ DWORD i, size = MAX_PATH;
GetProfilesDirectoryW(buf, &size);
for (i = 0; i < size; ++i){
if (buf[i] == '\\') buf[i] = '/';