🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.bug
Article #1149

Re: problems compiling X11R5 PL17 with gcc 2.2.2 [sun4, SunOS 4.1.2]

#1149
From: Rainer Klute
Date: Tue, 15 Sep 1992 10:28
45 lines
2137 bytes
In article <9209141908.AA03141@phantom.cislabs.pitt.edu>,
qralston@cislabs.pitt.EDU (James Ralston Crawford) writes:
|> 
|> gcc -fpcc-struct-return -c -O2    -I../../.      gram.c
|> In file included from twm.h:297, from gram.c:44:
|> /long_gcc_path/include/stdlib.h:29: conflicting types for `malloc'
|> gram.c:1: previous declaration of `malloc'
|> /long_gcc_path/include/stdlib.h:33: conflicting types for `realloc'
|> gram.c:1: previous declaration of `realloc'


The problem stems from the broken SunOS yacc which prepends the generated
code with non-ANSI definitions for malloc() and realloc(). The following
patch to twm's Imakefile "fixes" the problem by brute force:


*** /tmp/RCSAa24446     Tue Sep 15 12:23:32 1992
--- mit/clients/twm/Imakefile   Thu Aug 13 18:18:07 1992
***************
*** 32,41 ****
--- 32,48 ----
  ComplexProgramTarget(twm)
  InstallNonExecFile(system.twmrc,$(TWMDIR))
  
+ #if HasGcc2 && defined (SunArchitecture)
  gram.h gram.c: gram.y
        yacc $(YFLAGS) gram.y
+       sed -e 's/^extern char \*malloc(), \*realloc();//g' y.tab.c >gram.c
+       $(MV) y.tab.h gram.h
+ #else
+ gram.h gram.c: gram.y
+       yacc $(YFLAGS) gram.y
        $(MV) y.tab.c gram.c
        $(MV) y.tab.h gram.h
+ #endif
  
  clean::
        $(RM) y.tab.h y.tab.c lex.yy.c gram.h gram.c lex.c deftwmrc.c 


-- 
  Dipl.-Inform. Rainer Klute      klute@irb.informatik.uni-dortmund.de
  Univ. Dortmund, IRB
  Postfach 500500         |)|/    Tel.: +49 231 755-4663
D-W4600 Dortmund 50       |\|\    Fax : +49 231 755-2386
Technical Details
Message-ID: <194dsfINNp5s@fbi-news.Informatik.Uni-Dortmund.DE>
Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!tommy.informatik.uni-dortmund.de!klute
References: <9209141908.AA03141@phantom.cislabs.pitt.edu>

Show Full Headers
Complete Article Headers
Newsgroups: gnu.gcc.bug
Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!tommy.informatik.uni-dortmund.de!klute
From: klute@tommy.informatik.uni-dortmund.de (Rainer Klute)
Subject: Re: problems compiling X11R5 PL17 with gcc 2.2.2 [sun4, SunOS 4.1.2]
Message-ID: <194dsfINNp5s@fbi-news.Informatik.Uni-Dortmund.DE>
Sender: gnulists@ai.mit.edu
Organization: CS Department, Dortmund University, Germany
References: <9209141908.AA03141@phantom.cislabs.pitt.edu>
Distribution: gnu
Date: Tue, 15 Sep 1992 10:28:31 GMT
Approved: bug-gcc@prep.ai.mit.edu
Lines: 46