GNU bug report logs - #17056
dfa.c patch for systems with no locale support

Previous Next

Package: grep;

Reported by: Aharon Robbins <arnold <at> skeeve.com>

Date: Fri, 21 Mar 2014 11:42:01 UTC

Severity: normal

Tags: patch

Done: Paul Eggert <eggert <at> cs.ucla.edu>

Bug is archived. No further changes may be made.

Full log


Message #8 received at 17056 <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Aharon Robbins <arnold <at> skeeve.com>, 17056 <at> debbugs.gnu.org
Subject: Re: bug#17056: dfa.c patch for systems with no locale support
Date: Fri, 21 Mar 2014 11:09:15 -0700
That's odd, as DJGPP has <locale.h> which is supposed to declare 
setlocale and define LC_ALL, according to 
<http://www.delorie.com/djgpp/doc/libc/libc_705.html>.  Could you 
explain what goes wrong?

Does the following patch fix the problem?  It should isolate the issue 
better.

diff --git a/src/dfa.c b/src/dfa.c
index 5e60cd5..92ac1b9 100644
--- a/src/dfa.c
+++ b/src/dfa.c
@@ -34,7 +34,11 @@
 #include <locale.h>
 #include <stdbool.h>

-/* Gawk doesn't use Gnulib, so don't assume static_assert is present.  */
+/* Gawk doesn't use Gnulib, so don't assume that setlocale and
+   static_assert are present.  */
+#ifndef LC_ALL
+# define setlocale(category, locale) NULL
+#endif
 #ifndef static_assert
 # define static_assert(cond, diagnostic) \
     extern int (*foo (void)) [!!sizeof (struct { int foo: (cond) ? 8 : 
-1; })]





This bug report was last modified 11 years and 112 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.