bug-grep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 1/5] maint: ensure that MB_CUR_MAX is defined even when !MBS_


From: Paolo Bonzini
Subject: Re: [PATCH 1/5] maint: ensure that MB_CUR_MAX is defined even when !MBS_SUPPORT
Date: Mon, 10 Oct 2011 09:35:33 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:6.0.2) Gecko/20110906 Thunderbird/6.0.2

On 10/09/2011 09:00 PM, Aharon Robbins wrote:
Hi.

Having variables grep_mb_cur_max and dfa_mb_cur_max (separate for the
reasons Arnold explained) would work, but it would make it impossible
for the compiler to throw away the multibyte code when MBS_SUPPORT is zero.

Why?

#if MBS_SUPPORT
int greb_mb_cur_max = MB_CUR_MAX; /* or initialize it in main */
#else
#define grep_mb_cur_max 1
#endif

Hmmm.  Maybe I should try a proof-of-concept for this in gawk... :-)

I did that and it works ok. At least with GCC. :-)

Patches are welcome. :)

Paolo




reply via email to

[Prev in Thread] Current Thread [Next in Thread]