This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH 10/17] Regex: Portability to non-GCC compilers.
- From: Florian Weimer <fweimer at redhat dot com>
- To: Arnold Robbins <arnold at skeeve dot com>, carlos at redhat dot com, libc-alpha at sourceware dot org
- Date: Fri, 8 Dec 2017 10:26:53 +0100
- Subject: Re: [PATCH 10/17] Regex: Portability to non-GCC compilers.
- Authentication-results: sourceware.org; auth=none
- References: <201712080916.vB89GxSs005509@skeeve.com>
On 12/08/2017 10:16 AM, Arnold Robbins wrote:
+#if !defined(__GNUC__) || __GNUC__ < 3
+ static short utf8_sb_map_inited = 0;
+
+ if (! utf8_sb_map_inited)
+ {
+ int i;
+
+ utf8_sb_map_inited = 0;
+ for (i = 0; i <= 0x80 / BITSET_WORD_BITS - 1; i++)
+ utf8_sb_map[i] = BITSET_WORD_MAX;
+ }
+#endif
This doesn't look like a good idea because it's not thread-safe.
Thanks,
Florian