0.6.7.24: fixed some gcc warnings
authorWilliam Harold Newman <william.newman@airmail.net>
Sun, 22 Oct 2000 15:31:05 +0000 (15:31 +0000)
committerWilliam Harold Newman <william.newman@airmail.net>
Sun, 22 Oct 2000 15:31:05 +0000 (15:31 +0000)
NEWS
src/runtime/arch.h
src/runtime/breakpoint.c
src/runtime/coreparse.c
src/runtime/gencgc.c
src/runtime/gencgc.h
src/runtime/interr.c
src/runtime/interr.h
src/runtime/monitor.c
src/runtime/runtime.h
version.lisp-expr

diff --git a/NEWS b/NEWS
index aa5bb23..d6d74d3 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -502,11 +502,13 @@ changes in sbcl-0.6.8 relative to sbcl-0.6.7:
   of static symbols.
 * FINISH-OUTPUT is now called more consistently on QUIT. (It
   used to not be called for a saved Lisp image.)
+?? A bug related to the signal handling rewrite, keeping the DEBUG:ARG 
+  function from working, was fixed.
 * Martin Atzmueller's version of a patch to fix a compiler crash,
   as posted on sbcl-devel 13 September 2000, has been installed.
 * Instead of installing Martin Atzmueller's patch for the
   compiler transform for SUBSEQ, I deleted the compiler transform,
-  and transforms for some similar consing operations (CONCATENATE
+  and transforms for some similar consing operations.
 ?? A bug in signal handling which kept TRACE from working on OpenBSD
   has been fixed.
   ?? Remember to remove this from the port-specific section of BUGS.
@@ -520,7 +522,7 @@ changes in sbcl-0.6.8 relative to sbcl-0.6.7:
   (through GENESIS and the sbcl.h file). Therefore, patching the
   address map is less unnecessarily tedious and error-prone. The
   Lisp names of address space constants have also been systematized.
-?? CVS tags like dollar-Header-dollar have been removed from
+* CVS tags like dollar-Header-dollar have been removed from
   the sources, because they have never saved me trouble and
   they've been source of trouble working with patches and other
   diff-related operations.
index 088a266..02a5d18 100644 (file)
@@ -31,5 +31,6 @@ extern lispobj funcall1(lispobj function, lispobj arg0);
 extern lispobj funcall2(lispobj function, lispobj arg0, lispobj arg1);
 extern lispobj funcall3(lispobj function, lispobj arg0, lispobj arg1,
                        lispobj arg2);
+extern lispobj *component_ptr_from_pc(lispobj *pc);
 
 #endif /* __ARCH_H__ */
index 903591a..44f78d7 100644 (file)
@@ -85,7 +85,8 @@ static lispobj find_code(os_context_t *context)
 #ifdef __i386__
 static lispobj find_code(os_context_t *context)
 {
-  lispobj codeptr = component_ptr_from_pc(*os_context_pc_addr(context));
+  lispobj codeptr =
+      (lispobj)component_ptr_from_pc((lispobj *)(*os_context_pc_addr(context)));
 
   if (codeptr == 0) {
       return NIL;
index 5476fa5..cd841f4 100644 (file)
@@ -27,6 +27,8 @@
 #include "runtime.h"
 #include "globals.h"
 #include "core.h"
+#include "arch.h"
+#include "interr.h"
 #include "sbcl.h"
 
 static void process_directory(int fd, long *ptr, int count)
index 948ac48..8619da0 100644 (file)
@@ -6315,8 +6315,10 @@ clear_auto_gc_trigger(void)
     auto_gc_trigger = 0;
 }
 \f
-/* Find the code object for the given pc, or return NULL on failure. */
-lispobj*
+/* Find the code object for the given pc, or return NULL on failure.
+ *
+ * FIXME: PC shouldn't be lispobj*, should it? Maybe void*? */
+lispobj *
 component_ptr_from_pc(lispobj *pc)
 {
     lispobj *object = NULL;
index 9b5b0dd..85304fe 100644 (file)
@@ -97,4 +97,5 @@ void sniff_code_object(struct code *code, unsigned displacement);
 int  update_x86_dynamic_space_free_pointer(void);
 void  gc_alloc_update_page_tables(int unboxed,
                                  struct alloc_region *alloc_region);
+
 #endif _GENCGC_H_
index 1333881..1fd412c 100644 (file)
@@ -39,7 +39,7 @@ set_lossage_handler(void handler(void))
     lossage_handler = handler;
 }
 
-void
+never_returns
 lose(char *fmt, ...)
 {
     va_list ap;
@@ -53,6 +53,8 @@ lose(char *fmt, ...)
     fprintf(stderr, "\n");
     fflush(stderr);
     lossage_handler();
+    fprintf(stderr, "Argh! lossage_handler() returned, total confusion..\n");
+    exit(1);
 }
 \f
 /* internal error handler for when the Lisp error system doesn't exist
index 989ddab..5e10394 100644 (file)
@@ -12,7 +12,7 @@
 #ifndef _INTERR_H_
 #define _INTERR_H_
 
-extern void lose(char *fmt, ...);
+extern never_returns lose(char *fmt, ...);
 extern void set_lossage_handler(void fun(void));
 extern void describe_internal_error(os_context_t *context);
 
index 09ec960..bc3800e 100644 (file)
@@ -28,6 +28,7 @@
 #include "monitor.h"
 #include "print.h"
 #include "arch.h"
+#include "interr.h"
 #include "gc.h"
 #include "search.h"
 #include "purify.h"
@@ -150,20 +151,25 @@ static void regs_cmd(char **ptr)
     printf("BSP\t=\t0x%08X\n", (unsigned long)current_binding_stack_pointer);
 #endif
 #ifdef __i386__
-    printf("BSP\t=\t0x%08X\n", SymbolValue(BINDING_STACK_POINTER));
+    printf("BSP\t=\t0x%08lx\n",
+          (unsigned long)SymbolValue(BINDING_STACK_POINTER));
 #endif
 
-    printf("DYNAMIC\t=\t0x%08lX\n", (unsigned long)DYNAMIC_SPACE_START);
+    printf("DYNAMIC\t=\t0x%08lx\n", (unsigned long)DYNAMIC_SPACE_START);
 #if defined(ibmrt) || defined(__i386__)
-    printf("ALLOC\t=\t0x%08lX\n", SymbolValue(ALLOCATION_POINTER));
-    printf("TRIGGER\t=\t0x%08lX\n", SymbolValue(INTERNAL_GC_TRIGGER));
+    printf("ALLOC\t=\t0x%08lx\n",
+          (unsigned long)SymbolValue(ALLOCATION_POINTER));
+    printf("TRIGGER\t=\t0x%08lx\n",
+          (unsigned long)SymbolValue(INTERNAL_GC_TRIGGER));
 #else
     printf("ALLOC\t=\t0x%08X\n",
           (unsigned long)dynamic_space_free_pointer);
-    printf("TRIGGER\t=\t0x%08X\n", (unsigned long)current_auto_gc_trigger);
+    printf("TRIGGER\t=\t0x%08lx\n", (unsigned long)current_auto_gc_trigger);
 #endif
-    printf("STATIC\t=\t0x%08lX\n", SymbolValue(STATIC_SPACE_FREE_POINTER));
-    printf("RDONLY\t=\t0x%08lX\n", SymbolValue(READ_ONLY_SPACE_FREE_POINTER));
+    printf("STATIC\t=\t0x%08lx\n",
+          (unsigned long)SymbolValue(STATIC_SPACE_FREE_POINTER));
+    printf("RDONLY\t=\t0x%08lx\n",
+          (unsigned long)SymbolValue(READ_ONLY_SPACE_FREE_POINTER));
 
 #ifdef MIPS
     printf("FLAGS\t=\t0x%08x\n", current_flags_register);
@@ -244,27 +250,27 @@ static void call_cmd(char **ptr)
                    goto fdefn;
                }
            }
-           printf("symbol 0x%08lx is undefined.\n", thing);
+           printf("symbol 0x%08lx is undefined.\n", (long unsigned)thing);
            return;
 
          case type_Fdefn:
          fdefn:
            function = FDEFN(thing)->function;
            if (function == NIL) {
-               printf("fdefn 0x%08lx is undefined.\n", thing);
+               printf("fdefn 0x%08lx is undefined.\n", (long unsigned)thing);
                return;
            }
            break;
          default:
-           printf(
-             "0x%08lx is not a function pointer, symbol, or fdefn object.\n",
-                  thing);
+           printf("0x%08lx is not a function pointer, symbol, "
+                  "or fdefn object.\n",
+                  (long unsigned)thing);
            return;
        }
     }
     else if (LowtagOf(thing) != type_FunctionPointer) {
         printf("0x%08lx is not a function pointer, symbol, or fdefn object.\n",
-              thing);
+              (long unsigned)thing);
         return;
     }
     else
@@ -273,25 +279,27 @@ static void call_cmd(char **ptr)
     numargs = 0;
     while (more_p(ptr)) {
        if (numargs >= 3) {
-           printf("Too many arguments. (3 at most)\n");
+           printf("too many arguments (no more than 3 allowed)\n");
            return;
        }
        args[numargs++] = parse_lispobj(ptr);
     }
 
     switch (numargs) {
-      case 0:
+    case 0:
        result = funcall0(function);
        break;
-      case 1:
+    case 1:
        result = funcall1(function, args[0]);
        break;
-      case 2:
+    case 2:
        result = funcall2(function, args[0], args[1]);
        break;
-      case 3:
+    case 3:
        result = funcall3(function, args[0], args[1], args[2]);
        break;
+    default:
+       lose("unsupported argument count");
     }
 
     print(result);
@@ -348,7 +356,8 @@ static void print_context(os_context_t *context)
                                                                i)));
 #endif
        }
-       printf("PC:\t\t  0x%08lx\n", *os_context_pc_addr(context));
+       printf("PC:\t\t  0x%08lx\n",
+              (unsigned long)(*os_context_pc_addr(context)));
 }
 
 static void print_context_cmd(char **ptr)
@@ -415,8 +424,9 @@ static void catchers_cmd(char **ptr)
             printf("0x%08lX:\n\tuwp: 0x%08lX\n\tfp: 0x%08lX\n\tcode: 0x%08lx\n\tentry: 0x%08lx\n\ttag: ",
                   (unsigned long)catch, (unsigned long)(catch->current_uwp),
                   (unsigned long)(catch->current_cont),
-                  component_ptr_from_pc(catch->entry_pc) + type_OtherPointer,
-                  catch->entry_pc);
+                  (unsigned long)component_ptr_from_pc((void*)catch->entry_pc) +
+                  type_OtherPointer,
+                  (unsigned long)catch->entry_pc);
 #endif
             brief_print((lispobj)catch->tag);
             catch = catch->previous_catch;
index a2b1fae..0fdfffa 100644 (file)
@@ -97,4 +97,13 @@ typedef int boolean;
 #define SymbolFunction(sym) \
     (((struct fdefn *)(SymbolValue(sym)-type_OtherPointer))->function)
 
+/* 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, you might just get a few more bytes of compiled code or
+ * a few more compiler warnings. -- WHN 2000-10-21 */
+typedef volatile void never_returns;
+
 #endif /* _SBCL_RUNTIME_H_ */
index 492f475..4c3dc83 100644 (file)
@@ -15,4 +15,4 @@
 ;;; versions, and a string a la "0.6.5.12" is used for versions which
 ;;; aren't released but correspond only to CVS tags or snapshots.
 
-"0.6.7.23"
+"0.6.7.24"