[uim-commit] r1924 - branches/r5rs/sigscheme
yamaken at freedesktop.org
yamaken at freedesktop.org
Tue Nov 1 01:51:09 PST 2005
Author: yamaken
Date: 2005-11-01 01:51:04 -0800 (Tue, 01 Nov 2005)
New Revision: 1924
Modified:
branches/r5rs/sigscheme/error.c
branches/r5rs/sigscheme/sigscheme.h
Log:
* sigscheme/sigscheme.h
- (SCM_NORETURN): New macro
- (SigScm_Error, SigScm_ErrorObj): Modify with SCM_NORETURN
* sigscheme/error.c
- (throw_exception):
* Ditto
* ensure exit(3) at last to suppress warning about noreturn
Modified: branches/r5rs/sigscheme/error.c
===================================================================
--- branches/r5rs/sigscheme/error.c 2005-11-01 09:36:47 UTC (rev 1923)
+++ branches/r5rs/sigscheme/error.c 2005-11-01 09:51:04 UTC (rev 1924)
@@ -62,6 +62,11 @@
/*=======================================
File Local Function Declarations
=======================================*/
+static void throw_exception(ScmObj errorobj) SCM_NORETURN;
+
+/*=======================================
+ Function Implementations
+=======================================*/
static void throw_exception(ScmObj errorobj)
{
#if SCM_EXCEPTION_HANDLING
@@ -78,14 +83,11 @@
#else
if (SigScm_DebugCategories() & SCM_DBG_BACKTRACE)
SigScm_ShowBacktrace();
+#endif
exit(EXIT_FAILURE);
-#endif
}
-/*=======================================
- Function Implementations
-=======================================*/
int SigScm_Die(const char *msg, const char *filename, int line) {
if (SigScm_DebugCategories() & SCM_DBG_ERRMSG) {
SigScm_ShowErrorHeader();
@@ -98,7 +100,7 @@
exit(EXIT_FAILURE);
/* NOTREACHED */
- return 1;
+ return 1; /* dummy value for boolean expression */
}
void SigScm_Error(const char *msg, ...)
Modified: branches/r5rs/sigscheme/sigscheme.h
===================================================================
--- branches/r5rs/sigscheme/sigscheme.h 2005-11-01 09:36:47 UTC (rev 1923)
+++ branches/r5rs/sigscheme/sigscheme.h 2005-11-01 09:51:04 UTC (rev 1924)
@@ -57,8 +57,10 @@
=======================================*/
#ifdef __GNUC__
#define SCM_NOINLINE __attribute__((noinline))
+#define SCM_NORETURN __attribute__((noreturn))
#else
#define SCM_NOINLINE
+#define SCM_NORETURN
#endif /* __GNUC__ */
#define SCM_REINTERPRET_CAST(type, obj) (*(type *)&(obj))
@@ -620,8 +622,8 @@
/* error.c */
int SigScm_Die(const char *msg, const char *filename, int line);
-void SigScm_Error(const char *msg, ...);
-void SigScm_ErrorObj(const char *msg, ScmObj obj);
+void SigScm_Error(const char *msg, ...) SCM_NORETURN;
+void SigScm_ErrorObj(const char *msg, ScmObj obj) SCM_NORETURN;
void SigScm_ShowBacktrace(void);
/* debug.c */
More information about the uim-commit
mailing list