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
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#ifdef HAVE_ALLOCA_H
# include <alloca.h>
#endif
#ifdef HAVE_WHATEVER_H
# include <whatever.h>
#endif
...
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?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Diff to nr-pathops.c
Logged In: YES
user_id=36222
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
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#ifdef HAVE_ALLOCA_H
# include <alloca.h>
#endif
#ifdef HAVE_WHATEVER_H
# include <whatever.h>
#endif
...
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?
Logged In: YES
user_id=36222
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.