Re: [RFC/PATCH] Use compatibility regex library for OSX/Darwin
- From
Mike Ralphson <mike.ralphson@gmail.com>
- Date
- Sep 10, 2008, 08:03 UTC
- Message-ID
- <e2b179460809100103t4266650bnac00097cfb86c0b1@mail.gmail.com>
- In-Reply-To
- <20080907184537.GA4148@regex.yaph.org>
2008/9/7 Arjen Laarhoven <arjen@yaph.org>
Show 8 quoted lines
> The standard libc regex library on OSX does not support alternation > in POSIX Basic Regular Expression mode. This breaks the diff.funcname > functionality on OSX. > > Also, I'm sure the problem occurs on more non-Linux systems (or non > GNU libc systems). If people who have access to those systems (BSD's, > HP-UX, AIX, etc) can test it, I'd be happy to add those systems to the > patch so it can fix for multiple systems at once.
I can confirm that the issue shown up by your new testcase is also present in AIX 5.3.
Doing the mv's and adding regex.o to COMPAT_OBJS works fine and compat/lib.a is suitably amended
ar -t compat/lib.a regex.o ...
but I'm afraid I don't know how to get the combination of gcc + AIX ld to link to this in preference to the system defined regex functions. At least I guess this is what's happening.
Adding -lcompat/regex to COMPAT_CFLAGS as per your Darwin hunk provokes lots of warnings:
gcc: -lcompat/regex: linker input file unused because linking not done
... (" for each .c file)
LINK git-fast-import
collect2: library libcompat/regex not foundThat said, I'm not specifically arguing in favour of the patch (I wouldn't know a regex alternation if it bit me), someone writing regexs on HP-UX might expect them to work like the rest of their OS...
If the shipped java funcname pattern requires alternation then the testcase should stand though.
Mike