This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Regex support for libiberty
- To: Jeff Johnston <jjohnstn at touchme dot toronto dot redhat dot com>
- Subject: Re: Regex support for libiberty
- From: "Zack Weinberg" <zackw at stanford dot edu>
- Date: Thu, 17 May 2001 17:04:20 -0700
- Cc: gcc-patches at gcc dot gnu dot org, jjohnstn at redhat dot com
- References: <Pine.LNX.4.33.0105161636410.24862-300000@touchme.toronto.redhat.com>
On Wed, May 16, 2001 at 04:55:35PM -0400, Jeff Johnston wrote:
> Hello,
>
> The attached patches add regex support to libiberty.
>
> The new regex code was created by taking the gnu-regex code from gdb and
> adding 'x' in front of externally visible names. For external names
> starting with underscores, the 'x' was added after any underscores.
Rather than add prefixes, why don't you de-export all functions other
than the ones specified by POSIX, and cause libiberty to probe for the
standard functions in libc, as is done for lots of other such
replacements?
You should also rip out all of the code which is #ifdef emacs.
[...]
> + /* Don't bother to use a fastmap when searching. This simplifies the
> + REG_NEWLINE case: if we used a fastmap, we'd have to put all the
> + characters after newlines into the fastmap. This way, we just try
> + every character. */
> + preg->fastmap = 0;
This is an old version of regex.c which is extremely slow. Please use
gcc/fixinc/gnu-regex.c instead, or posix/regex.c from GNU libc.
--
zw I met a traveller from an antique land
Who said: 'Your name is Ozymandias,
king of kings, and I claim my five pounds!'
-- Del Cotter