This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: toplev.c
> > In toplev.c I read:
> >
> > #ifdef __alpha
> > extern char *sbrk ();
> > #endif
> >
> > Now, this prototype is needed not only for alpha, but for all 64bit
> > platforms which have sizeof(void *) > sizeof(int).
SUSv2 says that sbrk is a void*, not a char *. I don't really know if
that means anything to anyone. It also says that this function will be
prototyped in <unistd.h>. A quick check of system around here (none
of which claim to be SUSV2) shows that this does seem to be the case.
Regardless of what the vendor provides, if a proto for it is in unistd.h,
most of the plumbing is in place to let autoconf take advantage of this.
Of course, if __alpha (OpenVMS? DUNIX? Embedded?) doesn't proto it here,
this does no good.
> Anyone want to fix this up? It shouldn't be all that hard for something
> that knows autoconf.
Here's a starting place. Of course, the real test is whether it helps
whatever system #if __alpha really refers to...
Sun Jan 18 15:26:21 1998 Robert Lipe (robertl@dgii.com)
* toplev.c (sbrk): get prototype from <unistd.h> when
available.
$ cvs diff toplev.c
Index: toplev.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/toplev.c,v
retrieving revision 1.28
diff -u -p -r1.28 toplev.c
--- toplev.c 1998/01/17 22:39:10 1.28
+++ toplev.c 1998/01/18 21:25:39
@@ -62,6 +62,10 @@ Boston, MA 02111-1307, USA. */
# include <sys/times.h>
#endif
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif
+
#include "input.h"
#include "tree.h"
#include "rtl.h"
@@ -189,10 +193,6 @@ int print_single_switch ();
void print_switch_values ();
/* Length of line when printing switch values. */
#define MAX_LINE 75
-
-#ifdef __alpha
-extern char *sbrk ();
-#endif
/* Name of program invoked, sans directories. */
--
Robert Lipe http://www.dgii.com/people/robertl robertl@dgii.com