Building with revision r9190 I get the following warning.
--
config/gen/platform/generic/memalign.c: In function `Parrot_memalign':
config/gen/platform/generic/memalign.c:12: warning: implicit declaration of function `posix_memalign'
--
Which seemed odd, as I know my platform provides posix_memalign. cpp
confirms that stdlib.h isn't providing the prototype.
--
$ cpp -DPARROT_HAS_POSIX_MEMALIGN config/gen/platform/generic/memalign.c | grep posix_memalign
int i = posix_memalign(&p, align, size);
--
Which makes sense, as neither _XOPEN_SOURCE or _GNU_SOURCE is #defined.
So I make the following change:
--
Index: config/gen/platform/generic/memalign.c
===================================================================
--- config/gen/platform/generic/memalign.c (revision 9190)
+++ config/gen/platform/generic/memalign.c (working copy)
@@ -3,6 +3,7 @@
*/
#if defined(PARROT_HAS_POSIX_MEMALIGN)
+#define _XOPEN_SOURCE 600
#include <stdlib.h>
void *
--
And now cpp is showing that the proper prototype is being sucked in.
--
$ cpp -DPARROT_HAS_POSIX_MEMALIGN config/gen/platform/generic/memalign.c | grep posix_memalign
extern int posix_memalign (void **__memptr, size_t __alignment, size_t __size)
int i = posix_memalign(&p, align, size);
--
So I run `make distclean && perl Configure.pl && make` and the warning
is *still* there (different line number).
--
config/gen/platform/generic/memalign.c: In function `Parrot_memalign':
config/gen/platform/generic/memalign.c:13: warning: implicit declaration of function `posix_memalign'
--
My only guess is that somehow _STDLIB_H is being defined before #include
in memalign.c is processed by cpp. This has a really bad smell to it.
This is on Linux/AMD64 w/ gcc-3.4.4 & glibc-2.3.5 and multilib header
files.
-J
--