[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
PATCH: Fix bash 2.05b compilation on IRIX 5.3
From: |
Rainer Orth |
Subject: |
PATCH: Fix bash 2.05b compilation on IRIX 5.3 |
Date: |
Tue, 29 Jul 2003 00:50:25 +0200 (MEST) |
I just tried to build bash 2.05b on IRIX 5.3 with the vendor cc, and ran
into two problems:
* lib/sh/fmtumax.c failed to compile since intmax_t/uintmax_t weren't
defined. This is easily fixed by including <inttypes.h> which provides
those definitions.
* lib/malloc/malloc.c initially failed to compile with a syntax error in
line 904. After some investigation, it turned out that this is due to a
label without following statement, as in this minimal example:
void
label (void)
{
label:
}
Adding a return; after the label fixes that problem. This affected
malloc.c since none of MALLOC_{STATS, TRACE, REGISTER, WATCH} are
defined. But even after this fix, malloc.c wouldn't compile:
cfe: Error: malloc.c, line 293: redeclaration of 'botch'; previous declaration
at line 261 in file 'malloc.c'
botch (s, file, line)
^
cfe: Error: malloc.c, line 293: prototype declaration and non-prototype
definition found for botch, the type of this parameter is not compatible with
the type after applying default argument promotion
botch (s, file, line)
------^
This could be fixed by declaring botch's argument types.
The following patch contains both fixes.
Rainer
-----------------------------------------------------------------------------
Rainer Orth, Faculty of Technology, Bielefeld University
Tue Jul 29 00:47:15 2003 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
* lib/malloc/malloc.c (botch): Declare args.
(internal_free): Return explicitly.
* lib/sh/fmtulong.c [HAVE_INTTYPES_H]: Include <inttypes.h>.
===================================================================
RCS file: lib/malloc/RCS/malloc.c,v
retrieving revision 1.1
diff -up -r1.1 lib/malloc/malloc.c
--- lib/malloc/malloc.c 2002/06/21 19:16:49 1.1
+++ lib/malloc/malloc.c 2003/07/28 22:38:37
@@ -291,6 +291,9 @@ extern void mtrace_free __P((PTR_T, int,
#if !defined (botch)
static void
botch (s, file, line)
+ const char *s;
+ const char *file;
+ int line;
{
fprintf (stderr, "malloc: failed assertion: %s\n", s);
(void)fflush (stderr);
@@ -901,6 +904,8 @@ free_return:
if (_malloc_nwatch > 0)
_malloc_ckwatch (mem, file, line, W_FREE, ubytes);
#endif
+
+ return;
}
static PTR_T
===================================================================
RCS file: lib/sh/RCS/fmtulong.c,v
retrieving revision 1.1
diff -up -r1.1 lib/sh/fmtulong.c
--- lib/sh/fmtulong.c 2002/01/02 18:00:27 1.1
+++ lib/sh/fmtulong.c 2003/07/28 22:39:46
@@ -38,6 +38,10 @@
#ifdef HAVE_STDINT_H
# include <stdint.h>
#endif
+
+#ifdef HAVE_INTTYPES_H
+# include <inttypes.h>
+#endif
#include <chartypes.h>
#include <errno.h>
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- PATCH: Fix bash 2.05b compilation on IRIX 5.3,
Rainer Orth <=