From 6208e9ee15dbdea405f53d70046f034fc3e0777b Mon Sep 17 00:00:00 2001 From: Gabor Melis Date: Fri, 19 Aug 2005 14:25:29 +0000 Subject: [PATCH] 0.9.3.65: * compile runtime without warnings on gcc4 (except for one recently acquired warning related to MAGIC_HASH_VECTOR_VALUE in gencgc.c) --- src/runtime/coreparse.c | 2 +- src/runtime/interr.c | 2 +- src/runtime/interr.h | 2 +- src/runtime/interrupt.c | 8 ++++++-- src/runtime/monitor.h | 4 ++-- src/runtime/runtime.h | 16 ++++++++++------ src/runtime/save.c | 4 ++-- src/runtime/x86-64-arch.h | 2 +- src/runtime/x86-arch.h | 2 +- version.lisp-expr | 2 +- 10 files changed, 26 insertions(+), 18 deletions(-) diff --git a/src/runtime/coreparse.c b/src/runtime/coreparse.c index dd74c74..57639ec 100644 --- a/src/runtime/coreparse.c +++ b/src/runtime/coreparse.c @@ -182,7 +182,7 @@ load_core_file(char *file) FSHOW((stderr, "build_id[]=\"%s\"\n", build_id)); FSHOW((stderr, "remaining_len = %d\n", remaining_len)); - if (remaining_len != strlen(build_id)) + if (remaining_len != strlen((const char *)build_id)) goto losing_build_id; for (i = 0; i < remaining_len; ++i) { FSHOW((stderr, "ptr[%d] = char = %d, expected=%d\n", diff --git a/src/runtime/interr.c b/src/runtime/interr.c index 64eacea..9238601 100644 --- a/src/runtime/interr.c +++ b/src/runtime/interr.c @@ -43,7 +43,7 @@ set_lossage_handler(void handler(void)) lossage_handler = handler; } -never_returns +void lose(char *fmt, ...) { va_list ap; diff --git a/src/runtime/interr.h b/src/runtime/interr.h index 5e10394..3ebe8a1 100644 --- a/src/runtime/interr.h +++ b/src/runtime/interr.h @@ -12,7 +12,7 @@ #ifndef _INTERR_H_ #define _INTERR_H_ -extern never_returns lose(char *fmt, ...); +extern void lose(char *fmt, ...) never_returns; extern void set_lossage_handler(void fun(void)); extern void describe_internal_error(os_context_t *context); diff --git a/src/runtime/interrupt.c b/src/runtime/interrupt.c index d711858..e82a8cd 100644 --- a/src/runtime/interrupt.c +++ b/src/runtime/interrupt.c @@ -897,14 +897,18 @@ void interrupt_thread_handler(int num, siginfo_t *info, void *v_context) * thread interrupt execution is undefined. */ struct thread *th=arch_os_get_current_thread(); struct cons *c; + lispobj function; if (th->state != STATE_RUNNING) - lose("interrupt_thread_handler: thread %ld in wrong state: %d\n", + lose("interrupt_thread_handler: thread %lu in wrong state: %d\n", th->os_thread,fixnum_value(th->state)); get_spinlock(&th->interrupt_fun_lock,(long)th); c=((struct cons *)native_pointer(th->interrupt_fun)); - arrange_return_to_lisp_function(context,c->car); + function=c->car; th->interrupt_fun=c->cdr; release_spinlock(&th->interrupt_fun_lock); + if (function==NIL) + lose("interrupt_thread_handler: NIL function\n"); + arrange_return_to_lisp_function(context,function); } #endif diff --git a/src/runtime/monitor.h b/src/runtime/monitor.h index f899466..9a75652 100644 --- a/src/runtime/monitor.h +++ b/src/runtime/monitor.h @@ -9,5 +9,5 @@ * files for more information. */ -extern void throw_to_monitor(void); -extern void monitor_or_something(void); +extern void throw_to_monitor(void) never_returns; +extern void monitor_or_something(void) never_returns; diff --git a/src/runtime/runtime.h b/src/runtime/runtime.h index 48f0710..425db45 100644 --- a/src/runtime/runtime.h +++ b/src/runtime/runtime.h @@ -148,11 +148,15 @@ typedef int boolean; /* KLUDGE: As far as I can tell there's no ANSI C way of saying * "this function never returns". This is the way that you do it - * in GCC later than version 2.7 or so. If you are using some - * compiler that doesn't understand this, you could could just - * change it to "typedef void never_returns" and nothing would - * break, though you might get a few more bytes of compiled code or - * a few more compiler warnings. -- WHN 2000-10-21 */ -typedef volatile void never_returns; + * in GCC later than version 2.5 or so. */ +#if defined(__GNUC__) +#if __GNUC_PREREQ(2,5) +#define never_returns __attribute__ ((noreturn)) +#else +#define never_returns +#endif +#else +#define never_returns +#endif #endif /* _SBCL_RUNTIME_H_ */ diff --git a/src/runtime/save.c b/src/runtime/save.c index 450d3a4..4ace124 100644 --- a/src/runtime/save.c +++ b/src/runtime/save.c @@ -131,10 +131,10 @@ save(char *filename, lispobj init_function) write_lispobj(/* (We're writing the word count of the entry here, and the 2 * term is one word for the leading BUILD_ID_CORE_ENTRY_TYPE_CODE * word and one word where we store the count itself.) */ - 2 + strlen(build_id), + 2 + strlen((const char *)build_id), file); { - char *p; + unsigned char *p; for (p = build_id; *p; ++p) write_lispobj(*p, file); } diff --git a/src/runtime/x86-64-arch.h b/src/runtime/x86-64-arch.h index 4cb9d4c..90b5150 100644 --- a/src/runtime/x86-64-arch.h +++ b/src/runtime/x86-64-arch.h @@ -16,7 +16,7 @@ * here? (The answer wasn't obvious to me when merging the * architecture-abstracting patches for CSR's SPARC port. -- WHN 2002-02-15) */ -extern never_returns lose(char *fmt, ...); +#include "interr.h" static inline void get_spinlock(volatile lispobj *word,long value) diff --git a/src/runtime/x86-arch.h b/src/runtime/x86-arch.h index 6c7802a..b4ce701 100644 --- a/src/runtime/x86-arch.h +++ b/src/runtime/x86-arch.h @@ -16,7 +16,7 @@ * here? (The answer wasn't obvious to me when merging the * architecture-abstracting patches for CSR's SPARC port. -- WHN 2002-02-15) */ -extern never_returns lose(char *fmt, ...); +#include "interr.h" static inline void get_spinlock(volatile lispobj *word,long value) diff --git a/version.lisp-expr b/version.lisp-expr index 0281078..1f4da9a 100644 --- a/version.lisp-expr +++ b/version.lisp-expr @@ -17,4 +17,4 @@ ;;; checkins which aren't released. (And occasionally for internal ;;; versions, especially for internal versions off the main CVS ;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".) -"0.9.3.64" +"0.9.3.65" -- 1.7.10.4