This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 10/17] Regex: Portability to non-GCC compilers.


On 12/08/2017 10:47 AM, arnold@skeeve.com wrote:
Florian Weimer <fweimer@redhat.com> wrote:

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.

Is the rest of regex thread safe?

I've no objection to something else that does the trick for GLIBC.
Gawk doesn't have multiple threads.

It does not matter for glibc because it's compiled with GCC. It might matter if this code is merged into gnulib, which is supposed to be portable to many compilers and environments.

Thanks,
Florian


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]