From 5e5215eba77007511fb040ac842a935ec624b4a6 Mon Sep 17 00:00:00 2001 From: John Gilmore Date: Tue, 20 Aug 1991 03:02:39 +0000 Subject: * mcheck.c: Avoid warning about undeclared abort fn. * tm-sparc.h (PC_ADJUST): Avoid calling error() from this; it causes recursive calls to error() when used in cleanups. To do so requires that we make it a function, so we do. * sparc-tdep.c (sparc_pc_adjust): New implem of PC_ADJUST. * utils.c (do_cleanups): Remove the current cleanup from the chain *before* calling it, in case error() is called from it. The result won't be pretty, but won't be an infinite loop either. --- gdb/mcheck.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'gdb/mcheck.c') diff --git a/gdb/mcheck.c b/gdb/mcheck.c index 2c4d2fc..611a378 100755 --- a/gdb/mcheck.c +++ b/gdb/mcheck.c @@ -28,8 +28,15 @@ static void EXFUN((*old_free_hook), (PTR ptr)); static PTR EXFUN((*old_malloc_hook), (size_t size)); static PTR EXFUN((*old_realloc_hook), (PTR ptr, size_t size)); +/* FIXME. We cannot *declare* abort() as either being void or being + int, because if the system declares it as the other, we get a fatal + error. It's senseless to configure the system for whether abort is + void or int. So we simply fail to declare it, which works on all + systems, but might produce a warning on yours. Please ignore the warning + and raise your middle finger in the general direction of the ANSI C + committee in tribute. */ /* Function to call when something awful happens. */ -static void EXFUN((*abortfunc), (void)) = abort; +static void EXFUN((*abortfunc), (void)) = (void (*)()) abort; /* Arbitrary magical numbers. */ #define MAGICWORD 0xfedabeeb -- cgit v1.1