[squid-dev] g++ 4.8.x and std::regex problems

Amos Jeffries squid3 at treenet.co.nz
Tue Nov 29 02:29:42 UTC 2016


Please note that GCC 4.8 is not capable of building correctly operating 
Squid-4 either. So its not a matter of GCC 4.8 vs Squid. It is a 
question of whether GCC 4.9 is still the newest available GCC on any OS. 
Sadly it seems needed still for CentOS 7 and probably RHEL 7 too.


On 29/11/2016 11:21 a.m., Marcus Kool wrote:
>
>
> On 11/28/2016 07:46 PM, Alex Rousskov wrote:
>> Please undo that commit and let's discuss whether switching from
>> libregex to std::regex now is a good idea.
>>
>>
>> Thank you,
>>
>> Alex.
>
> Has anybody considered using RE2?
> It is a regex library that is fast, C++ source, high quality, public 
> domain, and is supported by older compilers.

That one has not been investigated until just now, I took a brief look. 
The research and testing of this was done in 2008-2014 timeframe.

It looks to me like we cannot use RE2 without a wrapper layer. With v5 
using std::regex the library needs to implement the portable <regex> 
API, then it just needs to be linked in.

When I revert that patch as Alex requested we are back to being stuck 
with the GNURegex API. There are only two libraries I'm aware of 
implementing that API. The GnuRegex bundled with Squid which is horribly 
slow, and the modern version of that library which is available in 
Linux, BSD, etc as -lregex.

The std::regex is for most OS implemented using the libregex that was 
there anyway and probably already being linked to Squid as -lregex. The 
other cases it is supposed to be implemented by something faster, like 
libpcre. The benefits to Squid are that the API is standardized and we 
dont have to care about which library is linked any more. In all cases 
it should be using either the same library as before behind the STL API, 
or something better.

Amos



More information about the squid-dev mailing list