Am Mon, 06 Mar 2000 schrieb Akim Demaille:
>| OK, how about this one?
>
>Sorry, I don't mean to be pain, but I still have some comments :) Do
>the other people consider I am being painful? (Real question)
A real pein :-).
>Still, my comment would be that
>
>| #ifdef __cplusplus
>| -extern "C" { void *malloc(unsigned); }
>| +# ifdef HAVE_STDLIB_H
>| +# include <stdlib.h>
>| +# endif
>| +# ifdef HAVE_UNISTD_H
>| +# include <unistd.h>
>| +# endif
>| +# ifdef HAVE_SYS_STAT_H
>| +# include <sys/stat.h>
>| +# endif
>| #else
>| -char *malloc();
>| +char *malloc ();
>| #endif
>
>I would not condition the includes by __cplusplus, since the C
>compiler will be happy too to have them. What do other people think?
>Also, ifdef and ifndef are banished from Autoconf, use only #if and
>#if !.
Banished from autoconf? Why? What do you gain with that rule?
>How about
>
>#if HAVE_STDLIB_H
># include <stdlib.h>
>#else
>char *malloc ();
>#endif
>#if HAVE_UNISTD_H
># include <unistd.h>
>#endif
>#if HAVE_SYS_STAT_H
># include <sys/stat.h>
>#endif
Well, I don't want to revamp the whole testcase, I just want to fix a single
bug under certain circumstances (g++ >= 2.95, glibc, linux). Note that I didn't
add the __cplusplus in the first place, but someone did and someone decided
to _not_ include stdlib.h in the first place to get a c++-safe
malloc-prototype. Thinking about it I actually believe my previous patch was
better, it didn't assume that the system header files are properly wrapped with
extern "C".
Franz.