🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.help
Article #52528

Re: Small oddities encountered when building X11 R5 pl 12 with gcc 2.2.2

#52528
From: Theodore S. Kapela
Date: Tue, 30 Jun 1992 13:10
48 lines
2587 bytes
>
>- gram.c is created by doing "yacc -d gram.y".  This creates a gram.c with
>  this at the very beginning:
>
>extern char *malloc(), *realloc();
>
># line 42 "gram.y"
>#include <stdio.h>
>#include <ctype.h>
>#include "twm.h"
>...

It appears that the SunOS distribution "yacc" doesn't entirely produce
ANSI code.  I have had this problem with several packages (including
the ISODE 8.0) that I have tried to build with gcc.  I no longer use
yacc.  In the case of the ISODE, it is a pain.  You need to find the
Makefiles that explicitly call "yacc", and change them to "$(YACC)".
This defaults to "yacc", but I define it as "bison -y", which
imitates the output behaviours of "yacc", and it produces ANSI C code.

>
>- gcc's "finxincludes" takes <stdlib.h> and modifies it to change the return
>  value of "malloc" and "realloc" (among other things) to be "void *" instead
>  of "char *", as of gcc 2.2
>

I believe this is because the ANSI spec calls for malloc/realloc to return
a type void *, instead of char *.

>- Am I the first person to try a full build of X11 R5 since 2.2/2.2.1/2.2.2
>  came out?  (-:  "fixincludes" didn't change those "stdlib.h" return values
>  until 5 days after 2.1 came out (see the ChangeLog file).

No.  I build X11R5 with gcc 2.2.2, sparc-sun-sunos4.1.2 and had the same
problems as you.  At the time, though, I just commented out the line from 
gram.c with the offending (re)declarations.

>  I presume "bison" might also fix this problem as well.

(See above).  Also, if you built gcc yourself, you should already have
bison installed. (I seem to remember that it is required to build gcc)


-- 
..............................................................................
 Theodore S. Kapela				kapela@poly.edu
 Center for Applied Large-Scale Computing	
 Polytechnic University
Technical Details
Message-ID: <1992Jun30.131011.29771@prism.poly.edu>
Path: arc1-ca.pugleaf.net!sparky!uunet!wupost!zaphod.mps.ohio-state.edu!swrinde!cs.utexas.edu!qt.cs.utexas.edu!yale.edu!cmcl2!prism.poly.edu!kapela
References: <9206280057.AA06346@poseur.JPL.NASA.GOV>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 11318c,e673592d3a3bec84
X-Google-Attributes: gid11318c,public
X-Google-ArrivalTime: 1992-06-30 00:52:54 PST
Path: arc1-ca.pugleaf.net!sparky!uunet!wupost!zaphod.mps.ohio-state.edu!swrinde!cs.utexas.edu!qt.cs.utexas.edu!yale.edu!cmcl2!prism.poly.edu!kapela
From: kapela@prism.poly.edu (Theodore S. Kapela)
Newsgroups: gnu.gcc.help
Subject: Re: Small oddities encountered when building X11 R5 pl 12 with gcc 2.2.2
Summary: "bison -y" as a substitute for "yacc"
Message-ID: <1992Jun30.131011.29771@prism.poly.edu>
Date: 30 Jun 92 13:10:11 GMT
References: <9206280057.AA06346@poseur.JPL.NASA.GOV>
Distribution: gnu
Organization: Polytechnic University, New York
Lines: 48