alloca(3C) is defined in <alloca.h> on Solaris.
Diff to nr-pathops.c
Logged In: YES
Ditto for Tru64 UNIX, but I think the problem is even more
widespread than just nr-pathops.c.
For example, several of the files don't include stdlib.h,
even though that's where the prototype for malloc() is.
Without the prototype, a C89-conforming compiler will assume
a return type of `int'. On an LP64 platform, that's going
to cause problems, because the actual return type (void *)
is larger than int. This can and does lead to crashes.
What needs to happen is that configure.in needs to be
modified to check for a few more header files (alloca.h, for
one), and then all the files need to have a
# include <config.h>
# include <alloca.h>
# include <whatever.h>
and so on.
I have a patch that does most of this already, but it still
needs some work. I'm willing to put in that work if there's
a chance the patch will be incorporated.
Comments from the developers?
For those that are interested, I think the patch I'm
attaching catches all of the files at call malloc() or
alloca(), and includes (conditionally) stdlib.h, malloc.h,
and/or alloca.h, if the platform has them.
It adds a bunch of header checks to configure.in, so you
would need autoconf to be able to use this patch.
Log in to post a comment.