[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Problem with gl_REGEX and C++
From: |
Paolo Bonzini |
Subject: |
Re: Problem with gl_REGEX and C++ |
Date: |
Thu, 15 Jan 2009 20:49:26 +0100 |
User-agent: |
Thunderbird 2.0.0.19 (Macintosh/20081209) |
Albert Chin wrote:
> gl_REGEX from m4/regex.m4 cannot be reliably tested under C++. The
> problem is:
> static struct re_pattern_buffer regex;
> unsigned char folded_chars[UCHAR_MAX + 1];
> ...
> regex.translate = folded_chars;
>
> If the `translate' member is char * on some platforms, this test will
> fail.
>
> On RHEL4, g++ returns:
> error: invalid conversion from `unsigned char*' to `char*'
> because the `translate' member is char *. RHEL5 work fine as the
> `translate' member is unsigned char *.
Just as an advance warning, don't try getting this in glibc. :-)
Paolo