[PATCH] PR 10957

Richard Earnshaw rearnsha@arm.com
Fri Jun 20 18:04:00 GMT 2003


> > malloc() and free() should be declared in stdlib.h. 
> > Why isn't that 
> > sufficient?  A quick look at
> > newlib/libc/include/stdlib.h shows 
> > appropriate definitions there.
> 
> They are and you're correct, the patch seems wrong:
> 
> this guard around stdlib.h is failing when building
> with newlib:
> #  if defined STDC_HEADERS || defined _LIBC
> 
> Dumb question of the day: we check for stdlib.h in
> configure. Why not simply use that to determine
> whether we include it?
> 

Err, sorry, I don't follow.  libiberty/hashtab.c has

#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif

so what's the problem?


R.

[hmm, md5.c does seem to use the above, but you weren't patching that.  On 
the other hand, newlib *IS* ISO C compliant, so I would expect configure 
to detect that and define STDC_HEADERS]




More information about the Gcc-patches mailing list