🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.bug
Article #51

index, rindex, and gcc-2.3.1

#51
From: Cliff Krumvieda
Date: Mon, 02 Nov 1992 12:09
66 lines
2315 bytes
Howdy:

I had some trouble compiling gcc-2.3.1 on our HP 9000/834 running
HP-UX 7.00.  It seems that the files ""c-typeck.c", "cccp.c", and
"collect2.c" assume that the functions "index" and "rindex" exist.  In
the 2.2.2 version of cccp.c there were explicit #define's of index and
rindex to strchr and strrchr, respectively, so I just mocked them into
the 2.3.1 source:

======================================================================
% diff -c c-typeck.c-dist c-typeck.c
*** c-typeck.c-dist     Mon Oct 26 19:02:20 1992
--- c-typeck.c  Mon Nov  2 16:13:24 1992
***************
*** 33,38 ****
--- 33,43 ----
  #include "c-tree.h"
  #include "flags.h"
  
+ #ifdef USG
+ #define index strchr
+ #define rindex strrchr
+ #endif
+ 
  extern char *index ();
  extern char *rindex ();
  
======================================================================
% diff -c cccp.c-dist cccp.c
*** cccp.c-dist Sat Oct 24 21:06:43 1992
--- cccp.c      Mon Nov  2 15:39:38 1992
***************
*** 81,86 ****
--- 81,88 ----
  #include <sys/time.h>         /* for __DATE__ and __TIME__ */
  #include <sys/resource.h>
  #else
+ #define index strchr
+ #define rindex strrchr
  #include <time.h>
  #include <fcntl.h>
  #endif /* USG */
======================================================================
% diff -c collect2.c-dist collect2.c
*** collect2.c-dist     Thu Oct 15 02:10:55 1992
--- collect2.c  Mon Nov  2 16:21:05 1992
***************
*** 203,208 ****
--- 203,213 ----
  generic *xcalloc ();
  generic *xmalloc ();
  
+ #ifdef USG
+ #define index strchr
+ #define rindex strrchr
+ #endif
+ 
  extern char *index ();
  extern char *rindex ();
  

======================================================================

Hope this helps.

						--Cliff Krumvieda
Technical Details
Message-ID: <9211022209.AA26977@ask.cs.cornell.edu>
Path: arc1-ca.pugleaf.net!sparky!uunet!portal!lll-winken!iggy.GW.Vitalink.COM!cs.widener.edu!umn.edu!spool.mu.edu!caen!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!cs.cornell.edu!cliff

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!portal!lll-winken!iggy.GW.Vitalink.COM!cs.widener.edu!umn.edu!spool.mu.edu!caen!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!cs.cornell.edu!cliff
From: cliff@cs.cornell.edu (Cliff Krumvieda)
Newsgroups: gnu.gcc.bug
Subject: index, rindex, and gcc-2.3.1
Message-ID: <9211022209.AA26977@ask.cs.cornell.edu>
Date: 2 Nov 92 12:09:18 GMT
Sender: gnulists@ai.mit.edu
Distribution: gnu
Organization: Gnus Not Usenet
Lines: 66
Approved: bug-gcc@prep.ai.mit.edu