[alt.sources] Big Mistake in System V TCL distribution.

jfh@rpp386.cactus.org (John F. Haugh II) (03/23/90)

In article <FVE2U66xds13@ficc.uu.net> peter@ficc.uu.net (Peter da Silva) writes:
>In converting the program to System V, I inadvertently changed the
>string ``index'' to ``strchr'' in one place too many. Index is a tcl
>function. In tclBasic.c, in the table of function names, replace the
>occurrence of ``"strchr"'' with ``"index"''.

This is probably one of those things that falls under the heading
of "really big mistakes."  The number of systems which have "index"
as a library function is non-small.  Given that the most common
trick used to port USG stuff to BSD land is "-Dstrchr=index", you
are going to have [ and anyone else who intentionally pulls this
stunt ] one hell of a large body of people pissed off at you.
-- 
John F. Haugh II                             UUCP: ...!cs.utexas.edu!rpp386!jfh
Ma Bell: (512) 832-8832                           Domain: jfh@rpp386.cactus.org

mcdonald@aries.scs.uiuc.edu (Doug McDonald) (03/24/90)

In article <18169@rpp386.cactus.org> jfh@rpp386.cactus.org (John F. Haugh II) writes:
>In article <FVE2U66xds13@ficc.uu.net> peter@ficc.uu.net (Peter da Silva) writes:
>>In converting the program to System V, I inadvertently changed the
>>string ``index'' to ``strchr'' in one place too many. Index is a tcl
>>function. In tclBasic.c, in the table of function names, replace the
>>occurrence of ``"strchr"'' with ``"index"''.
>
>This is probably one of those things that falls under the heading
>of "really big mistakes."  The number of systems which have "index"
>as a library function is non-small.  Given that the most common
>trick used to port USG stuff to BSD land is "-Dstrchr=index", you
>are going to have [ and anyone else who intentionally pulls this
>stunt ] one hell of a large body of people pissed off at you.
>-- 

"index" as a function name in a C standard library is not allowed.
IF the C library in question has such a function, it is broken.

"index" is a perfectly valid function to be defined in a user program.
The "implemention defined" function names have a specific list of
first characters. "i" isn't included. Tell your vendor to fix their library.

peter@ficc.uu.net (Peter da Silva) (03/24/90)

In article <1990Mar23.164630.24318@ux1.cso.uiuc.edu> mcdonald@aries.scs.uiuc.edu (Doug McDonald) writes:
> "index" as a function name in a C standard library is not allowed.
> IF the C library in question has such a function, it is broken.

That's well and good, but in the real world you have to live with old
software and you have to de-facto treat anything in the BSD, System III,
Version 7, and System V libraries (including read, write, ioctl, and dup2
as well as index and rindex) as sacred.

If I had, in fact, done what John thought I did my ass would be grass. In
fact, though, I didn't. I'd prefer he hadn't jumped on my case before
checking the code... I know he has a copy... but he was at least as justified
in doing so as I've been on occasions when I've gone off half-cocked.
-- 
 _--_|\  `-_-' Peter da Silva. +1 713 274 5180. <peter@ficc.uu.net>.
/      \  'U`
\_.--._/
      v