* toplev.c
@ 1998-01-15 16:30 Jakub Jelinek
1998-01-17 1:40 ` toplev.c Andreas Schwab
` (2 more replies)
0 siblings, 3 replies; 8+ messages in thread
From: Jakub Jelinek @ 1998-01-15 16:30 UTC (permalink / raw)
To: egcs
Hi!
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).
Cheers,
Jakub
___________________________________________________________________
Jakub Jelinek | jj@sunsite.mff.cuni.cz | http://sunsite.mff.cuni.cz
Administrator of SunSITE Czech Republic, MFF, Charles University
___________________________________________________________________
Ultralinux - first 64bit OS to take full power of the UltraSparc
Linux version 2.1.77 on a sparc64 machine (333.41 BogoMips).
___________________________________________________________________
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: toplev.c
1998-01-15 16:30 toplev.c Jakub Jelinek
@ 1998-01-17 1:40 ` Andreas Schwab
1998-01-17 22:30 ` toplev.c Jeffrey A Law
1998-01-20 7:07 ` toplev.c Jeffrey A Law
2 siblings, 0 replies; 8+ messages in thread
From: Andreas Schwab @ 1998-01-17 1:40 UTC (permalink / raw)
To: Jakub Jelinek; +Cc: egcs
Jakub Jelinek <jj@sunsite.ms.mff.cuni.cz> writes:
|> Hi!
|> 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).
Actually every platform would benefit from it, unless there is a conflict
with some broken header.
--
Andreas Schwab "And now for something
schwab@issan.informatik.uni-dortmund.de completely different"
schwab@gnu.org
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: toplev.c
1998-01-15 16:30 toplev.c Jakub Jelinek
1998-01-17 1:40 ` toplev.c Andreas Schwab
@ 1998-01-17 22:30 ` Jeffrey A Law
1998-01-19 2:25 ` toplev.c Robert Lipe
1998-01-20 7:07 ` toplev.c Jeffrey A Law
2 siblings, 1 reply; 8+ messages in thread
From: Jeffrey A Law @ 1998-01-17 22:30 UTC (permalink / raw)
To: Jakub Jelinek; +Cc: egcs
In message < 199801151510.QAA00160@sunsite.ms.mff.cuni.cz >you write:
> Hi!
>
> 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).
Seems to me like this is something autoconf should be able to do for
us. Having stuff like this is simply unclean.
Anyone want to fix this up? It shouldn't be all that hard for something
that knows autoconf.
jeff
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: toplev.c
1998-01-17 22:30 ` toplev.c Jeffrey A Law
@ 1998-01-19 2:25 ` Robert Lipe
1998-01-20 2:21 ` toplev.c Klaus Kaempf
0 siblings, 1 reply; 8+ messages in thread
From: Robert Lipe @ 1998-01-19 2:25 UTC (permalink / raw)
To: law; +Cc: Jakub Jelinek, egcs
> > 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
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: toplev.c
1998-01-19 2:25 ` toplev.c Robert Lipe
@ 1998-01-20 2:21 ` Klaus Kaempf
0 siblings, 0 replies; 8+ messages in thread
From: Klaus Kaempf @ 1998-01-20 2:21 UTC (permalink / raw)
To: Robert Lipe; +Cc: egcs
>
> > > 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 *.
And so does DEC C on openVMS/Alpha. A patch for this was submitted by me
last year, I wonder where it went ...
>
>
> Sun Jan 18 15:26:21 1998 Robert Lipe (robertl@dgii.com)
> * toplev.c (sbrk): get prototype from <unistd.h> when
> available.
>
This doesn't work for DEC C on openVMS/Alpha since digital put the prototype
in <stdlib.h>. So I'd supposed adding
#ifdef HAVE_STDLIB_H
# include <stdlib.h>
#endif
would help a lot on VMS and shouldn't harm other systems.
Klaus
--
proGIS Software E-Mail: kkaempf@progis.de
Dipl.-Inform. Klaus K"ampf Fax: 0241-47067-29
Jakobstr. 117 Voice: 0241-47067-11
D-52064 Aachen WWW: http://www.progis.de
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: toplev.c
1998-01-15 16:30 toplev.c Jakub Jelinek
1998-01-17 1:40 ` toplev.c Andreas Schwab
1998-01-17 22:30 ` toplev.c Jeffrey A Law
@ 1998-01-20 7:07 ` Jeffrey A Law
2 siblings, 0 replies; 8+ messages in thread
From: Jeffrey A Law @ 1998-01-20 7:07 UTC (permalink / raw)
To: Jakub Jelinek; +Cc: egcs
In message < 199801151510.QAA00160@sunsite.ms.mff.cuni.cz >you write:
> Hi!
>
> In toplev.c I read:
>
> #ifdef __alpha
> extern char *sbrk ();
> #endif
I've made declaring sbrk an autoconf controlled action. So
hopefully all problems with sbrk should go away.
[ Note, I'm on the road right now, so it might not be checked in
for a few more days... ]
jeff
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: toplev.c
1998-01-19 2:06 toplev.c Kaveh R. Ghazi
@ 1998-01-19 9:41 ` Richard Henderson
0 siblings, 0 replies; 8+ messages in thread
From: Richard Henderson @ 1998-01-19 9:41 UTC (permalink / raw)
To: Kaveh R. Ghazi; +Cc: jj, schwab, egcs
On Sun, Jan 18, 1998 at 04:13:20PM -0500, Kaveh R. Ghazi wrote:
> You can add GCC_NEED_DECLARATION(sbrk) to configure.in and put
> #ifdef NEED_DECLARATION_SBRK wrapper around the extern decl.
Done.
r~
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: toplev.c
@ 1998-01-19 2:06 Kaveh R. Ghazi
1998-01-19 9:41 ` toplev.c Richard Henderson
0 siblings, 1 reply; 8+ messages in thread
From: Kaveh R. Ghazi @ 1998-01-19 2:06 UTC (permalink / raw)
To: jj, schwab; +Cc: egcs
> From: Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
>
> Jakub Jelinek <jj@sunsite.ms.mff.cuni.cz> writes:
>
> |> Hi!
> |> 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).
>
> Actually every platform would benefit from it, unless there is a conflict
> with some broken header.
> --
> Andreas Schwab "And now for something
You can add GCC_NEED_DECLARATION(sbrk) to configure.in and put
#ifdef NEED_DECLARATION_SBRK wrapper around the extern decl.
--Kaveh
--
Kaveh R. Ghazi Project Manager / Custom Development
ghazi@caip.rutgers.edu ICon CMT Corp.
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~1998-01-20 7:07 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-01-15 16:30 toplev.c Jakub Jelinek
1998-01-17 1:40 ` toplev.c Andreas Schwab
1998-01-17 22:30 ` toplev.c Jeffrey A Law
1998-01-19 2:25 ` toplev.c Robert Lipe
1998-01-20 2:21 ` toplev.c Klaus Kaempf
1998-01-20 7:07 ` toplev.c Jeffrey A Law
1998-01-19 2:06 toplev.c Kaveh R. Ghazi
1998-01-19 9:41 ` toplev.c Richard Henderson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).