Hello Jim, all,

on Tru64 4.0D I got this:

| cc -DHAVE_CONFIG_H -DEXEEXT=\"\" -DEXEEXT=\"\" -DNO_XMALLOC -DEXEEXT=\"\" -I. 
-I.. -I../../dummy-0/gllib  -I../intl -ieee  -g -c -o realloc.o 
../../dummy-0/gllib/realloc.c
| cc: Error: ../../dummy-0/gllib/realloc.c, line 56: In this statement, a 
common type could not be determined for the 2nd and 3rd operands ("malloc(...)" 
and "realloc(...)") of a conditional operator. (badcondit)
|   result = (p == NULL ? malloc (n) : realloc (p, n));
| ------------^
| gmake[3]: *** [realloc.o] Error 1

Here are some relevant config.h defines on this system:

#define HAVE_CALLOC 0
#define HAVE_CALLOC_POSIX 1
#define HAVE_MALLOC 0
#define HAVE_MALLOC_POSIX 1
#define HAVE_REALLOC 0
#define HAVE_REALLOC_POSIX 1
#define MALLOC_0_IS_NONNULL 0
#define REALLOC_0_IS_NONNULL 0
#define calloc rpl_calloc
#define malloc rpl_malloc
#define realloc rpl_realloc
/* #undef free */

So it seems malloc(0) isn't GNUish, but due to malloc being #defined
but not restored like realloc in realloc.c, there is a type mismatch,
as the rpl_malloc function is not declared.

OK to apply?  I have only done compile testing; there are more issues
before the `make check' stage on this system.  :-/

Cheers,
Ralf

2007-10-22  Ralf Wildenhues  <[EMAIL PROTECTED]>

        * lib/realloc.c [defined malloc]: Undefine, for prototype
        on Tru64 4.0D.  Also define NEED_REALLOC_GNU.

diff --git a/lib/realloc.c b/lib/realloc.c
index 18cc628..190e554 100644
--- a/lib/realloc.c
+++ b/lib/realloc.c
@@ -23,6 +23,10 @@
 # define NEED_REALLOC_GNU
 # undef realloc
 #endif
+#ifdef malloc
+# define NEED_REALLOC_GNU
+# undef malloc
+#endif
 
 /* Specification.  */
 #include <stdlib.h>


Reply via email to