home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / gnu / gcc / bug / 2343 < prev    next >
Encoding:
Text File  |  1992-09-15  |  2.0 KB  |  60 lines

  1. Newsgroups: gnu.gcc.bug
  2. Path: sparky!uunet!cis.ohio-state.edu!tommy.informatik.uni-dortmund.de!klute
  3. From: klute@tommy.informatik.uni-dortmund.de (Rainer Klute)
  4. Subject: Re: problems compiling X11R5 PL17 with gcc 2.2.2 [sun4, SunOS 4.1.2]
  5. Message-ID: <194dsfINNp5s@fbi-news.Informatik.Uni-Dortmund.DE>
  6. Sender: gnulists@ai.mit.edu
  7. Organization: CS Department, Dortmund University, Germany
  8. References: <9209141908.AA03141@phantom.cislabs.pitt.edu>
  9. Distribution: gnu
  10. Date: Tue, 15 Sep 1992 10:28:31 GMT
  11. Approved: bug-gcc@prep.ai.mit.edu
  12. Lines: 46
  13.  
  14. In article <9209141908.AA03141@phantom.cislabs.pitt.edu>,
  15. qralston@cislabs.pitt.EDU (James Ralston Crawford) writes:
  16. |> 
  17. |> gcc -fpcc-struct-return -c -O2    -I../../.      gram.c
  18. |> In file included from twm.h:297, from gram.c:44:
  19. |> /long_gcc_path/include/stdlib.h:29: conflicting types for `malloc'
  20. |> gram.c:1: previous declaration of `malloc'
  21. |> /long_gcc_path/include/stdlib.h:33: conflicting types for `realloc'
  22. |> gram.c:1: previous declaration of `realloc'
  23.  
  24.  
  25. The problem stems from the broken SunOS yacc which prepends the generated
  26. code with non-ANSI definitions for malloc() and realloc(). The following
  27. patch to twm's Imakefile "fixes" the problem by brute force:
  28.  
  29.  
  30. *** /tmp/RCSAa24446     Tue Sep 15 12:23:32 1992
  31. --- mit/clients/twm/Imakefile   Thu Aug 13 18:18:07 1992
  32. ***************
  33. *** 32,41 ****
  34. --- 32,48 ----
  35.   ComplexProgramTarget(twm)
  36.   InstallNonExecFile(system.twmrc,$(TWMDIR))
  37.   
  38. + #if HasGcc2 && defined (SunArchitecture)
  39.   gram.h gram.c: gram.y
  40.         yacc $(YFLAGS) gram.y
  41. +       sed -e 's/^extern char \*malloc(), \*realloc();//g' y.tab.c >gram.c
  42. +       $(MV) y.tab.h gram.h
  43. + #else
  44. + gram.h gram.c: gram.y
  45. +       yacc $(YFLAGS) gram.y
  46.         $(MV) y.tab.c gram.c
  47.         $(MV) y.tab.h gram.h
  48. + #endif
  49.   
  50.   clean::
  51.         $(RM) y.tab.h y.tab.c lex.yy.c gram.h gram.c lex.c deftwmrc.c 
  52.  
  53.  
  54. -- 
  55.   Dipl.-Inform. Rainer Klute      klute@irb.informatik.uni-dortmund.de
  56.   Univ. Dortmund, IRB
  57.   Postfach 500500         |)|/    Tel.: +49 231 755-4663
  58. D-W4600 Dortmund 50       |\|\    Fax : +49 231 755-2386
  59.  
  60.