John -

A few weeks ago I came across a problem in tcl6.1 that still remains in
your beta version 7.0. It concerns the Spencer regexp functions and their
incompatability with the POSIX regexp functions (at least as implemented in
gcc). The problem arises in an application that uses the POSIX regexp
functions either directly, or indirectly via a library that uses them,
and also uses tcl. Then the linker barfs because it has two versions
of regcomp/regexec to link in. I have this problem with an application
using tcl and Motif, where the Motif libraries use the POSIX regexp
functions.

Here are the problems:
1) The syntax of the calls is different. This could probably be solved
using config, and is not serious.

2) The data structures manipulated are different. Henry Spencer's code
uses an array of startp and an array of endp, POSIX uses a single array
of structures with elements {rm_so, rm_eo}. This too can be handled, but
I would imagine only by #ifdef _POSIX_'ing the code, and your code has
been remarkably free of that so far.

3) The regular expression grammar is actually different. POSIX uses \|
instead of |, \(...\) instead of (...). This is the last kind of thing
one would want in tcl - a syntax dependant on the compilation environment!
(At least, the grammar recognised by the GNU version of regcomp is
different.)

The solution I am using to this is to change all of the Henry Spencer
functions and data-types by just prefixing them with HS (as in HSregcomp).
This removes all name clashes, and everything is then quite happy.
To fix this at present requires access to the source code of either tcl
or of the offending application using the POSIX regcomp/regexec. This is
not feasible in general, especially if the offending application is
actually a purchased library with no source code available. I know that
the POSIX stuff has not been fully approved, but some clash is likely
in the future anyway. So could you put this (or any better way you can
come up with) into tcl 7.0 before it leaves beta stage.

Thanks,
			Jan Newmarch
