Article View: comp.std.c
Article #5468Re: Thoughts on `const' parameters
From: Joe Buck
Date: Wed, 07 Dec 1988 17:58
Date: Wed, 07 Dec 1988 17:58
31 lines
1970 bytes
1970 bytes
In article <957@vsi.COM> friedl@vsi.COM (Stephen J. Friedl) writes: >< P.S. - did anybody consider putting `index' and `rindex' into the standard? In article <9027@smoke.BRL.MIL>, gwyn@smoke.BRL.MIL (Doug Gwyn ) writes: >< Not for very long. They have been obsolete since 1980, although >< systems based on obsolete C technology (such as 4BSD) continue to >< provide them. Use strchr() and strrchr() instead. I can see why you think index and rindex reflect "obsolete C technology". strchr is identical to index, and strrchr is identical to rindex. But it wasn't BSD who introduced an incompatible name change, it was the USG folks. This didn't make the older names "obsolete", only incompatible, since at that point there were a lot of Version 7 unixes with the older names out there. Only with the adoption of the new C standard will the names "index" and "rindex" become obsolete. In article <965@vsi.COM> friedl@vsi.COM (Stephen J. Friedl) writes: >OK, does BSD have strchr() and strrchr()? Which versions of BSD? Bring your C compiler into the 20th century :-) ! Add #define strchr index #define strrchr rindex to your <string.h> or <strings.h> or whichever one BSD has. -- - Joe Buck jbuck@epimass.epi.com, or uunet!epimass.epi.com!jbuck, or jbuck%epimass.epi.com@uunet.uu.net for old Arpa sites I am of the opinion that my life belongs to the whole community, and as long as I live it is my privilege to do for it whatever I can. -- G. B. Shaw
Technical Details
Message-ID:
<2711@epimass.EPI.COM>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!bloom-beacon!apple!epimass!jbuckReferences:
<957@vsi.COM> <9027@smoke.BRL.MIL> <965@vsi.COM>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!bloom-beacon!apple!epimass!jbuck From: jbuck@epimass.EPI.COM (Joe Buck) Newsgroups: comp.std.c Subject: Re: Thoughts on `const' parameters Message-ID: <2711@epimass.EPI.COM> Date: 7 Dec 88 17:58:02 GMT References: <957@vsi.COM> <9027@smoke.BRL.MIL> <965@vsi.COM> Reply-To: jbuck@epimass.EPI.COM (Joe Buck) Distribution: comp Organization: Entropic Processing, Inc., Cupertino, CA Lines: 31