From unknown Sat Aug 16 21:16:48 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#17056 <17056@debbugs.gnu.org> To: bug#17056 <17056@debbugs.gnu.org> Subject: Status: dfa.c patch for systems with no locale support Reply-To: bug#17056 <17056@debbugs.gnu.org> Date: Sun, 17 Aug 2025 04:16:48 +0000 retitle 17056 dfa.c patch for systems with no locale support reassign 17056 grep submitter 17056 Aharon Robbins severity 17056 normal tag 17056 patch thanks From debbugs-submit-bounces@debbugs.gnu.org Fri Mar 21 07:41:04 2014 Received: (at submit) by debbugs.gnu.org; 21 Mar 2014 11:41:04 +0000 Received: from localhost ([127.0.0.1]:43056 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WQxot-0005jp-Va for submit@debbugs.gnu.org; Fri, 21 Mar 2014 07:41:04 -0400 Received: from eggs.gnu.org ([208.118.235.92]:40940) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WQxos-0005ji-CW for submit@debbugs.gnu.org; Fri, 21 Mar 2014 07:41:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WQxoi-0003s8-IX for submit@debbugs.gnu.org; Fri, 21 Mar 2014 07:41:01 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,T_MANY_HDRS_LCASE autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:48083) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WQxoi-0003s4-GV for submit@debbugs.gnu.org; Fri, 21 Mar 2014 07:40:52 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42628) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WQxob-00065e-5i for bug-grep@gnu.org; Fri, 21 Mar 2014 07:40:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WQxoT-0003qn-NF for bug-grep@gnu.org; Fri, 21 Mar 2014 07:40:45 -0400 Received: from mxout2.netvision.net.il ([194.90.9.21]:59460) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WQxoT-0003p3-Fo for bug-grep@gnu.org; Fri, 21 Mar 2014 07:40:37 -0400 MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; CHARSET=US-ASCII Received: from skeeve.com ([46.116.115.46]) by mxout2.netvision.net.il (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPS id <0N2S00LTBB37W8I0@mxout2.netvision.net.il> for bug-grep@gnu.org; Fri, 21 Mar 2014 13:40:19 +0200 (IST) Received: from skeeve.com (skeeve.com [127.0.0.1]) by skeeve.com (8.14.4/8.14.4/Debian-2ubuntu2.1) with ESMTP id s2LBeIKE003620 for ; Fri, 21 Mar 2014 13:40:18 +0200 Received: (from arnold@localhost) by skeeve.com (8.14.4/8.14.4/Submit) id s2LBeHJK003619 for bug-grep@gnu.org; Fri, 21 Mar 2014 13:40:17 +0200 From: Aharon Robbins Message-id: <201403211140.s2LBeHJK003619@skeeve.com> Date: Fri, 21 Mar 2014 13:40:17 +0200 To: bug-grep@gnu.org Subject: dfa.c patch for systems with no locale support User-Agent: Heirloom mailx 12.5 6/20/10 X-detected-operating-system: by eggs.gnu.org: Solaris 10 X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) Hi. This turned up in testing on DJGPP. Thanks, Arnold -------------------------- diff --git a/dfa.c b/dfa.c index 8771bbe..813c239 100644 --- a/dfa.c +++ b/dfa.c @@ -820,9 +820,13 @@ using_simple_locale (void) static int unibyte_c = -1; if (unibyte_c < 0) { +#ifdef LC_ALL char *locale = setlocale (LC_ALL, NULL); unibyte_c = (locale && (STREQ (locale, "C") || STREQ (locale, "POSIX"))); +#else + unibyte_c = 1; +#endif } return unibyte_c; } From debbugs-submit-bounces@debbugs.gnu.org Fri Mar 21 14:09:21 2014 Received: (at 17056) by debbugs.gnu.org; 21 Mar 2014 18:09:21 +0000 Received: from localhost ([127.0.0.1]:43852 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WR3se-0004Wc-MJ for submit@debbugs.gnu.org; Fri, 21 Mar 2014 14:09:21 -0400 Received: from smtp.cs.ucla.edu ([131.179.128.62]:47411) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WR3sb-0004WR-Kc for 17056@debbugs.gnu.org; Fri, 21 Mar 2014 14:09:18 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp.cs.ucla.edu (Postfix) with ESMTP id 7CAAAA60003; Fri, 21 Mar 2014 11:09:16 -0700 (PDT) X-Virus-Scanned: amavisd-new at smtp.cs.ucla.edu Received: from smtp.cs.ucla.edu ([127.0.0.1]) by localhost (smtp.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Ab8nfswUTh49; Fri, 21 Mar 2014 11:09:15 -0700 (PDT) Received: from penguin.cs.ucla.edu (Penguin.CS.UCLA.EDU [131.179.64.200]) by smtp.cs.ucla.edu (Postfix) with ESMTPSA id 93A63A60002; Fri, 21 Mar 2014 11:09:15 -0700 (PDT) Message-ID: <532C804B.1080008@cs.ucla.edu> Date: Fri, 21 Mar 2014 11:09:15 -0700 From: Paul Eggert Organization: UCLA Computer Science Department User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0 MIME-Version: 1.0 To: Aharon Robbins , 17056@debbugs.gnu.org Subject: Re: bug#17056: dfa.c patch for systems with no locale support References: <201403211140.s2LBeHJK003619@skeeve.com> In-Reply-To: <201403211140.s2LBeHJK003619@skeeve.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 17056 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) That's odd, as DJGPP has which is supposed to declare setlocale and define LC_ALL, according to . 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 #include -/* 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; })] From debbugs-submit-bounces@debbugs.gnu.org Sat Mar 22 18:53:01 2014 Received: (at control) by debbugs.gnu.org; 22 Mar 2014 22:53:01 +0000 Received: from localhost ([127.0.0.1]:45181 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WRUmi-0004Jl-RG for submit@debbugs.gnu.org; Sat, 22 Mar 2014 18:53:01 -0400 Received: from smtp.cs.ucla.edu ([131.179.128.62]:46952) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WRUmf-0004JZ-Nd for control@debbugs.gnu.org; Sat, 22 Mar 2014 18:52:58 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp.cs.ucla.edu (Postfix) with ESMTP id A995839E8017 for ; Sat, 22 Mar 2014 15:52:56 -0700 (PDT) X-Virus-Scanned: amavisd-new at smtp.cs.ucla.edu Received: from smtp.cs.ucla.edu ([127.0.0.1]) by localhost (smtp.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id PYsDS3HI2Ff8 for ; Sat, 22 Mar 2014 15:52:56 -0700 (PDT) Received: from [192.168.1.9] (pool-108-0-233-62.lsanca.fios.verizon.net [108.0.233.62]) by smtp.cs.ucla.edu (Postfix) with ESMTPSA id 6365539E8008 for ; Sat, 22 Mar 2014 15:52:56 -0700 (PDT) Message-ID: <532E1448.403@cs.ucla.edu> Date: Sat, 22 Mar 2014 15:52:56 -0700 From: Paul Eggert Organization: UCLA Computer Science Department User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 MIME-Version: 1.0 To: control@debbugs.gnu.org Subject: mark bugs that have patches Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) tags 17066 + patch tags 17056 + patch thanks From debbugs-submit-bounces@debbugs.gnu.org Sun Mar 23 16:21:18 2014 Received: (at 17056) by debbugs.gnu.org; 23 Mar 2014 20:21:18 +0000 Received: from localhost ([127.0.0.1]:46229 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WRotR-00012k-Fd for submit@debbugs.gnu.org; Sun, 23 Mar 2014 16:21:17 -0400 Received: from mxout2.netvision.net.il ([194.90.9.21]:40632) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WRotO-00012X-OG for 17056@debbugs.gnu.org; Sun, 23 Mar 2014 16:21:16 -0400 MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; CHARSET=US-ASCII Received: from skeeve.com ([46.116.115.46]) by mxout2.netvision.net.il (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPS id <0N2W001BMOHS3A31@mxout2.netvision.net.il> for 17056@debbugs.gnu.org; Sun, 23 Mar 2014 22:21:11 +0200 (IST) Received: from skeeve.com (skeeve.com [127.0.0.1]) by skeeve.com (8.14.4/8.14.4/Debian-2ubuntu2.1) with ESMTP id s2NKA8Mi007319 for <17056@debbugs.gnu.org>; Sun, 23 Mar 2014 22:10:08 +0200 Received: (from arnold@localhost) by skeeve.com (8.14.4/8.14.4/Submit) id s2NK1IDI007015; Sun, 23 Mar 2014 22:01:18 +0200 From: Aharon Robbins Message-id: <201403232001.s2NK1IDI007015@skeeve.com> Date: Sun, 23 Mar 2014 22:01:17 +0200 To: eggert@cs.ucla.edu, arnold@skeeve.com, 17056@debbugs.gnu.org Subject: Re: bug#17056: dfa.c patch for systems with no locale support References: <201403211140.s2LBeHJK003619@skeeve.com> <532C804B.1080008@cs.ucla.edu> In-reply-to: <532C804B.1080008@cs.ucla.edu> User-Agent: Heirloom mailx 12.5 6/20/10 X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 17056 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) Hi Paul. > Date: Fri, 21 Mar 2014 11:09:15 -0700 > From: Paul Eggert > To: Aharon Robbins , 17056@debbugs.gnu.org > Subject: Re: bug#17056: dfa.c patch for systems with no locale support > > That's odd, as DJGPP has which is supposed to declare > setlocale and define LC_ALL, according to > . Could you > explain what goes wrong? See the original report below. > Does the following patch fix the problem? It should isolate the issue > better. I didn't pass it on, since the failure is on LC_ALL. Arnold > Date: Tue, 18 Mar 2014 11:54:54 -0700 (PDT) > Subject: Re: [gawk-devel] beta tar ball > To: Aharon Robbins > > Content-Type: text/plain; charset=iso-8859-1 > > Aharon, > > I tried to compile gawk 4.1.0f with DJGPP and? I got the following: > > dfa.c: In function 'using_simple_locale': > dfa.c:823: error: 'LC_ALL' undeclared (first use in this function) > dfa.c:823: error: (Each undeclared identifier is reported only once > dfa.c:823: error: for each function it appears in.) > dfa.c:823: warning: initialization makes pointer from integer without a cast > make.exe[1]: *** [dfa.o] Error 1 > > Any ideas? From debbugs-submit-bounces@debbugs.gnu.org Sun Mar 23 17:16:51 2014 Received: (at 17056-done) by debbugs.gnu.org; 23 Mar 2014 21:16:51 +0000 Received: from localhost ([127.0.0.1]:46266 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WRplD-0002a7-Bb for submit@debbugs.gnu.org; Sun, 23 Mar 2014 17:16:51 -0400 Received: from smtp.cs.ucla.edu ([131.179.128.62]:54763) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WRplB-0002Zz-9z for 17056-done@debbugs.gnu.org; Sun, 23 Mar 2014 17:16:50 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp.cs.ucla.edu (Postfix) with ESMTP id E86E939E8012; Sun, 23 Mar 2014 14:16:48 -0700 (PDT) X-Virus-Scanned: amavisd-new at smtp.cs.ucla.edu Received: from smtp.cs.ucla.edu ([127.0.0.1]) by localhost (smtp.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 0Gqym0cjfHCI; Sun, 23 Mar 2014 14:16:48 -0700 (PDT) Received: from [192.168.1.9] (pool-108-0-233-62.lsanca.fios.verizon.net [108.0.233.62]) by smtp.cs.ucla.edu (Postfix) with ESMTPSA id 68B2939E8008; Sun, 23 Mar 2014 14:16:48 -0700 (PDT) Message-ID: <532F4F3F.3000705@cs.ucla.edu> Date: Sun, 23 Mar 2014 14:16:47 -0700 From: Paul Eggert Organization: UCLA Computer Science Department User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 MIME-Version: 1.0 To: Aharon Robbins , 17056-done@debbugs.gnu.org Subject: Re: bug#17056: dfa.c patch for systems with no locale support References: <201403211140.s2LBeHJK003619@skeeve.com> <532C804B.1080008@cs.ucla.edu> <201403232001.s2NK1IDI007015@skeeve.com> In-Reply-To: <201403232001.s2NK1IDI007015@skeeve.com> Content-Type: multipart/mixed; boundary="------------030404000409090305060704" X-Spam-Score: -2.8 (--) X-Debbugs-Envelope-To: 17056-done X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.8 (--) This is a multi-part message in MIME format. --------------030404000409090305060704 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Aharon Robbins wrote: > See the original report below I downloaded the DJGPP sources. LC_ALL is defined unless one compiles as a freestanding environment, in which case neither LC_ALL nor setlocale are declared. So my guess is that your correspondent is using a freestanding environment somehow, and the patch that I suggested should work. It's better to avoid #ifdefs inside functions so I installed this into the grep master (see attached) and am marking this as done; we can always resurrect it if my guess is wrong. --------------030404000409090305060704 Content-Type: text/plain; charset=UTF-8; name="0001-dfa-port-to-freestanding-DJGPP-Bug-17056.patch" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="0001-dfa-port-to-freestanding-DJGPP-Bug-17056.patch" RnJvbSBjM2E2OTNlODI5YWQ5ZDlhM2E3ZTc0YThjZmFkYjJlMWYwZGZhMzBkIE1vbiBTZXAg MTcgMDA6MDA6MDAgMjAwMQpGcm9tOiBQYXVsIEVnZ2VydCA8ZWdnZXJ0QGNzLnVjbGEuZWR1 PgpEYXRlOiBTdW4sIDIzIE1hciAyMDE0IDE0OjEwOjE4IC0wNzAwClN1YmplY3Q6IFtQQVRD SF0gZGZhOiBwb3J0IHRvIGZyZWVzdGFuZGluZyBESkdQUCAoQnVnIzE3MDU2KQoKKiBzcmMv ZGZhLmMgKHNldGxvY2FsZSkgWyFMQ19BTExdOiBEZWZpbmUgYSBkdW1teS4KLS0tCiBzcmMv ZGZhLmMgfCA2ICsrKysrLQogMSBmaWxlIGNoYW5nZWQsIDUgaW5zZXJ0aW9ucygrKSwgMSBk ZWxldGlvbigtKQoKZGlmZiAtLWdpdCBhL3NyYy9kZmEuYyBiL3NyYy9kZmEuYwppbmRleCA1 ZTYwY2Q1Li45MmFjMWI5IDEwMDY0NAotLS0gYS9zcmMvZGZhLmMKKysrIGIvc3JjL2RmYS5j CkBAIC0zNCw3ICszNCwxMSBAQAogI2luY2x1ZGUgPGxvY2FsZS5oPgogI2luY2x1ZGUgPHN0 ZGJvb2wuaD4KIAotLyogR2F3ayBkb2Vzbid0IHVzZSBHbnVsaWIsIHNvIGRvbid0IGFzc3Vt ZSBzdGF0aWNfYXNzZXJ0IGlzIHByZXNlbnQuICAqLworLyogR2F3ayBkb2Vzbid0IHVzZSBH bnVsaWIsIHNvIGRvbid0IGFzc3VtZSB0aGF0IHNldGxvY2FsZSBhbmQKKyAgIHN0YXRpY19h c3NlcnQgYXJlIHByZXNlbnQuICAqLworI2lmbmRlZiBMQ19BTEwKKyMgZGVmaW5lIHNldGxv Y2FsZShjYXRlZ29yeSwgbG9jYWxlKSBOVUxMCisjZW5kaWYKICNpZm5kZWYgc3RhdGljX2Fz c2VydAogIyBkZWZpbmUgc3RhdGljX2Fzc2VydChjb25kLCBkaWFnbm9zdGljKSBcCiAgICAg ZXh0ZXJuIGludCAoKmZvbyAodm9pZCkpIFshIXNpemVvZiAoc3RydWN0IHsgaW50IGZvbzog KGNvbmQpID8gOCA6IC0xOyB9KV0KLS0gCjEuOC41LjMKCg== --------------030404000409090305060704-- From debbugs-submit-bounces@debbugs.gnu.org Wed Mar 26 16:11:35 2014 Received: (at 17056-done) by debbugs.gnu.org; 26 Mar 2014 20:11:35 +0000 Received: from localhost ([127.0.0.1]:51365 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WSuAg-0001jx-8Z for submit@debbugs.gnu.org; Wed, 26 Mar 2014 16:11:34 -0400 Received: from mxout2.netvision.net.il ([194.90.9.21]:65338) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WSuAd-0001jn-AY for 17056-done@debbugs.gnu.org; Wed, 26 Mar 2014 16:11:32 -0400 MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; CHARSET=US-ASCII Received: from skeeve.com ([46.116.115.46]) by mxout2.netvision.net.il (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPS id <0N32001S4835V661@mxout2.netvision.net.il> for 17056-done@debbugs.gnu.org; Wed, 26 Mar 2014 22:11:29 +0200 (IST) Received: from skeeve.com (skeeve.com [127.0.0.1]) by skeeve.com (8.14.4/8.14.4/Debian-2ubuntu2.1) with ESMTP id s2QK8faj031862; Wed, 26 Mar 2014 22:08:41 +0200 Received: (from arnold@localhost) by skeeve.com (8.14.4/8.14.4/Submit) id s2QK8dkt031576; Wed, 26 Mar 2014 22:08:39 +0200 From: Aharon Robbins Message-id: <201403262008.s2QK8dkt031576@skeeve.com> Date: Wed, 26 Mar 2014 22:08:39 +0200 To: eggert@cs.ucla.edu, arnold@skeeve.com, 17056-done@debbugs.gnu.org Subject: Re: bug#17056: dfa.c patch for systems with no locale support References: <201403211140.s2LBeHJK003619@skeeve.com> <532C804B.1080008@cs.ucla.edu> <201403232001.s2NK1IDI007015@skeeve.com> <532F4F3F.3000705@cs.ucla.edu> In-reply-to: <532F4F3F.3000705@cs.ucla.edu> User-Agent: Heirloom mailx 12.5 6/20/10 X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 17056-done X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) Hi Paul. > Date: Sun, 23 Mar 2014 14:16:47 -0700 > From: Paul Eggert > To: Aharon Robbins , 17056-done@debbugs.gnu.org > Subject: Re: bug#17056: dfa.c patch for systems with no locale support > > Aharon Robbins wrote: > > > See the original report below > > I downloaded the DJGPP sources. LC_ALL is defined unless one compiles > as a freestanding environment, in which case neither LC_ALL nor > setlocale are declared. So my guess is that your correspondent is using > a freestanding environment somehow, and the patch that I suggested > should work. It's better to avoid #ifdefs inside functions so I > installed this into the grep master (see attached) and am marking this > as done; we can always resurrect it if my guess is wrong. I don't think your change is right: #ifndef LC_ALL # define setlocale(category, locale) NULL #endif If setlocale isn't available, we want to assume that we DO have a unibyte locale, in which case we should be defining this as # define setlocale(category, locale) ("C") No? I will pass the current dfa.c on to my tester, but I think it's still not quite right. Thanks, Arnold From debbugs-submit-bounces@debbugs.gnu.org Thu Mar 27 00:39:54 2014 Received: (at 17056-done) by debbugs.gnu.org; 27 Mar 2014 04:39:54 +0000 Received: from localhost ([127.0.0.1]:51634 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WT26b-00072f-LU for submit@debbugs.gnu.org; Thu, 27 Mar 2014 00:39:54 -0400 Received: from smtp.cs.ucla.edu ([131.179.128.62]:59725) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WT26X-00072R-Kg for 17056-done@debbugs.gnu.org; Thu, 27 Mar 2014 00:39:50 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp.cs.ucla.edu (Postfix) with ESMTP id 3285F39E8013; Wed, 26 Mar 2014 21:39:49 -0700 (PDT) X-Virus-Scanned: amavisd-new at smtp.cs.ucla.edu Received: from smtp.cs.ucla.edu ([127.0.0.1]) by localhost (smtp.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id x0ZPcDGnKDkI; Wed, 26 Mar 2014 21:39:48 -0700 (PDT) Received: from [192.168.1.9] (pool-108-0-233-62.lsanca.fios.verizon.net [108.0.233.62]) by smtp.cs.ucla.edu (Postfix) with ESMTPSA id 8B87F39E8008; Wed, 26 Mar 2014 21:39:48 -0700 (PDT) Message-ID: <5333AB94.6050106@cs.ucla.edu> Date: Wed, 26 Mar 2014 21:39:48 -0700 From: Paul Eggert Organization: UCLA Computer Science Department User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 MIME-Version: 1.0 To: Aharon Robbins , 17056-done@debbugs.gnu.org Subject: Re: bug#17056: dfa.c patch for systems with no locale support References: <201403211140.s2LBeHJK003619@skeeve.com> <532C804B.1080008@cs.ucla.edu> <201403232001.s2NK1IDI007015@skeeve.com> <532F4F3F.3000705@cs.ucla.edu> <201403262008.s2QK8dkt031576@skeeve.com> In-Reply-To: <201403262008.s2QK8dkt031576@skeeve.com> Content-Type: multipart/mixed; boundary="------------000102090005080803080100" X-Spam-Score: -2.7 (--) X-Debbugs-Envelope-To: 17056-done X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.7 (--) This is a multi-part message in MIME format. --------------000102090005080803080100 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Aharon Robbins wrote: > we should be defining this as > > # define setlocale(category, locale) ("C") Thanks, that sounds right. I installed the attached patch. --------------000102090005080803080100 Content-Type: text/plain; charset=UTF-8; name="0001-dfa-improve-port-to-freestanding-DJGPP.patch" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="0001-dfa-improve-port-to-freestanding-DJGPP.patch" RnJvbSAzNmUyMWFhNjkxM2FiZWRhMTIwNjJkODI5NDkyNGFmYmQ2MzEzOTM5IE1vbiBTZXAg MTcgMDA6MDA6MDAgMjAwMQpGcm9tOiBQYXVsIEVnZ2VydCA8ZWdnZXJ0QHBlbmd1aW4uY3Mu dWNsYS5lZHU+CkRhdGU6IFdlZCwgMjYgTWFyIDIwMTQgMjE6Mzc6NTQgLTA3MDAKU3ViamVj dDogW1BBVENIXSBkZmE6IGltcHJvdmUgcG9ydCB0byBmcmVlc3RhbmRpbmcgREpHUFAKCiog c3JjL2RmYS5jIChzZXRsb2NhbGUpIFshTENfQUxMXTogUmV0dXJuICJDIiwgbm90IE5VTEwg KEJ1ZyMxNzA1NikuCih1c2luZ19zaW1wbGVfbG9jYWxlKTogU3RvcmUgc2V0bG9jYWxlIHJl c3VsdCBpbiBhIHB0ci10by1jb25zdC4KLS0tCiBzcmMvZGZhLmMgfCA0ICsrLS0KIDEgZmls ZSBjaGFuZ2VkLCAyIGluc2VydGlvbnMoKyksIDIgZGVsZXRpb25zKC0pCgpkaWZmIC0tZ2l0 IGEvc3JjL2RmYS5jIGIvc3JjL2RmYS5jCmluZGV4IDBhMmI4YjguLmY4OGZmMmEgMTAwNjQ0 Ci0tLSBhL3NyYy9kZmEuYworKysgYi9zcmMvZGZhLmMKQEAgLTM3LDcgKzM3LDcgQEAKIC8q IEdhd2sgZG9lc24ndCB1c2UgR251bGliLCBzbyBkb24ndCBhc3N1bWUgdGhhdCBzZXRsb2Nh bGUgYW5kCiAgICBzdGF0aWNfYXNzZXJ0IGFyZSBwcmVzZW50LiAgKi8KICNpZm5kZWYgTENf QUxMCi0jIGRlZmluZSBzZXRsb2NhbGUoY2F0ZWdvcnksIGxvY2FsZSkgTlVMTAorIyBkZWZp bmUgc2V0bG9jYWxlKGNhdGVnb3J5LCBsb2NhbGUpICJDIgogI2VuZGlmCiAjaWZuZGVmIHN0 YXRpY19hc3NlcnQKICMgZGVmaW5lIHN0YXRpY19hc3NlcnQoY29uZCwgZGlhZ25vc3RpYykg XApAQCAtNzgzLDcgKzc4Myw3IEBAIHVzaW5nX3NpbXBsZV9sb2NhbGUgKHZvaWQpCiAgICAg ICBzdGF0aWMgaW50IHVuaWJ5dGVfYyA9IC0xOwogICAgICAgaWYgKHVuaWJ5dGVfYyA8IDAp CiAgICAgICAgIHsKLSAgICAgICAgICBjaGFyICpsb2NhbGUgPSBzZXRsb2NhbGUgKExDX0FM TCwgTlVMTCk7CisgICAgICAgICAgY2hhciBjb25zdCAqbG9jYWxlID0gc2V0bG9jYWxlIChM Q19BTEwsIE5VTEwpOwogICAgICAgICAgIHVuaWJ5dGVfYyA9IChsb2NhbGUgJiYgKFNUUkVR IChsb2NhbGUsICJDIikKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8fCBT VFJFUSAobG9jYWxlLCAiUE9TSVgiKSkpOwogICAgICAgICB9Ci0tIAoxLjguNS4zCgo= --------------000102090005080803080100-- From debbugs-submit-bounces@debbugs.gnu.org Thu Mar 27 14:50:56 2014 Received: (at 17056-done) by debbugs.gnu.org; 27 Mar 2014 18:50:56 +0000 Received: from localhost ([127.0.0.1]:53122 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WTFOB-0002Tu-Pq for submit@debbugs.gnu.org; Thu, 27 Mar 2014 14:50:56 -0400 Received: from mxout2.netvision.net.il ([194.90.9.21]:41643) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WTFO7-0002Tf-VG for 17056-done@debbugs.gnu.org; Thu, 27 Mar 2014 14:50:53 -0400 MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; CHARSET=US-ASCII Received: from skeeve.com ([46.116.115.46]) by mxout2.netvision.net.il (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPS id <0N3300EGSYX45MA1@mxout2.netvision.net.il> for 17056-done@debbugs.gnu.org; Thu, 27 Mar 2014 20:48:41 +0200 (IST) Received: from skeeve.com (skeeve.com [127.0.0.1]) by skeeve.com (8.14.4/8.14.4/Debian-2ubuntu2.1) with ESMTP id s2RImdl5019894; Thu, 27 Mar 2014 20:48:39 +0200 Received: (from arnold@localhost) by skeeve.com (8.14.4/8.14.4/Submit) id s2RImckr019893; Thu, 27 Mar 2014 20:48:38 +0200 From: Aharon Robbins Message-id: <201403271848.s2RImckr019893@skeeve.com> Date: Thu, 27 Mar 2014 20:48:38 +0200 To: eggert@cs.ucla.edu, arnold@skeeve.com, 17056-done@debbugs.gnu.org Subject: Re: bug#17056: dfa.c patch for systems with no locale support References: <201403211140.s2LBeHJK003619@skeeve.com> <532C804B.1080008@cs.ucla.edu> <201403232001.s2NK1IDI007015@skeeve.com> <532F4F3F.3000705@cs.ucla.edu> <201403262008.s2QK8dkt031576@skeeve.com> <5333AB94.6050106@cs.ucla.edu> In-reply-to: <5333AB94.6050106@cs.ucla.edu> User-Agent: Heirloom mailx 12.5 6/20/10 X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 17056-done X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) Hi Paul. > Date: Wed, 26 Mar 2014 21:39:48 -0700 > From: Paul Eggert > To: Aharon Robbins , 17056-done@debbugs.gnu.org > > Aharon Robbins wrote: > > we should be defining this as > > > > # define setlocale(category, locale) ("C") > > Thanks, that sounds right. I installed the attached patch. Actually, after a night's sleep, I think that was wrong. What if the system's setlocale() actually returns NULL? I suggest the below change to master. Thanks, Arnold ---------------------------------------------------------------- diff --git a/src/dfa.c b/src/dfa.c index f88ff2a..0fd8944 100644 --- a/src/dfa.c +++ b/src/dfa.c @@ -37,7 +37,7 @@ /* Gawk doesn't use Gnulib, so don't assume that setlocale and static_assert are present. */ #ifndef LC_ALL -# define setlocale(category, locale) "C" +# define setlocale(category, locale) NULL #endif #ifndef static_assert # define static_assert(cond, diagnostic) \ @@ -784,8 +784,9 @@ using_simple_locale (void) if (unibyte_c < 0) { char const *locale = setlocale (LC_ALL, NULL); - unibyte_c = (locale && (STREQ (locale, "C") - || STREQ (locale, "POSIX"))); + unibyte_c = (locale == NULL + || STREQ (locale, "C") + || STREQ (locale, "POSIX")); } return unibyte_c; } From debbugs-submit-bounces@debbugs.gnu.org Thu Mar 27 14:57:51 2014 Received: (at 17056-done) by debbugs.gnu.org; 27 Mar 2014 18:57:51 +0000 Received: from localhost ([127.0.0.1]:53130 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WTFUs-0002gP-4a for submit@debbugs.gnu.org; Thu, 27 Mar 2014 14:57:50 -0400 Received: from smtp.cs.ucla.edu ([131.179.128.62]:36710) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WTFUp-0002gE-Rl for 17056-done@debbugs.gnu.org; Thu, 27 Mar 2014 14:57:48 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp.cs.ucla.edu (Postfix) with ESMTP id 4E95239E8019; Thu, 27 Mar 2014 11:57:47 -0700 (PDT) X-Virus-Scanned: amavisd-new at smtp.cs.ucla.edu Received: from smtp.cs.ucla.edu ([127.0.0.1]) by localhost (smtp.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Q0Y94CJU2+8g; Thu, 27 Mar 2014 11:57:47 -0700 (PDT) Received: from penguin.cs.ucla.edu (Penguin.CS.UCLA.EDU [131.179.64.200]) by smtp.cs.ucla.edu (Postfix) with ESMTPSA id 008B239E8008; Thu, 27 Mar 2014 11:57:46 -0700 (PDT) Message-ID: <533474AA.3020608@cs.ucla.edu> Date: Thu, 27 Mar 2014 11:57:46 -0700 From: Paul Eggert Organization: UCLA Computer Science Department User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 MIME-Version: 1.0 To: Aharon Robbins , 17056-done@debbugs.gnu.org Subject: Re: bug#17056: dfa.c patch for systems with no locale support References: <201403211140.s2LBeHJK003619@skeeve.com> <532C804B.1080008@cs.ucla.edu> <201403232001.s2NK1IDI007015@skeeve.com> <532F4F3F.3000705@cs.ucla.edu> <201403262008.s2QK8dkt031576@skeeve.com> <5333AB94.6050106@cs.ucla.edu> <201403271848.s2RImckr019893@skeeve.com> In-Reply-To: <201403271848.s2RImckr019893@skeeve.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -2.7 (--) X-Debbugs-Envelope-To: 17056-done X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.7 (--) On 03/27/2014 11:48 AM, Aharon Robbins wrote: > What if > the system's setlocale() actually returns NULL? Then we don't know what the locale is. Perhaps setlocale ran out of memory and so returned NULL. If so, subsequent calls might use some weird Turkish locale with multibyte characters. So it sounds safer to assume the worst in that case. From debbugs-submit-bounces@debbugs.gnu.org Thu Mar 27 15:04:39 2014 Received: (at 17056-done) by debbugs.gnu.org; 27 Mar 2014 19:04:39 +0000 Received: from localhost ([127.0.0.1]:53134 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WTFbS-0002tv-Oq for submit@debbugs.gnu.org; Thu, 27 Mar 2014 15:04:39 -0400 Received: from mx1.redhat.com ([209.132.183.28]:22641) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WTFbP-0002tl-Dr for 17056-done@debbugs.gnu.org; Thu, 27 Mar 2014 15:04:37 -0400 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s2RJ4Xds029889 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 27 Mar 2014 15:04:33 -0400 Received: from [10.3.113.66] (ovpn-113-66.phx2.redhat.com [10.3.113.66]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s2RJ4Wdn024869; Thu, 27 Mar 2014 15:04:32 -0400 Message-ID: <53347640.4030409@redhat.com> Date: Thu, 27 Mar 2014 13:04:32 -0600 From: Eric Blake Organization: Red Hat, Inc. User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0 MIME-Version: 1.0 To: Paul Eggert , Aharon Robbins , 17056-done@debbugs.gnu.org Subject: Re: bug#17056: dfa.c patch for systems with no locale support References: <201403211140.s2LBeHJK003619@skeeve.com> <532C804B.1080008@cs.ucla.edu> <201403232001.s2NK1IDI007015@skeeve.com> <532F4F3F.3000705@cs.ucla.edu> <201403262008.s2QK8dkt031576@skeeve.com> <5333AB94.6050106@cs.ucla.edu> <201403271848.s2RImckr019893@skeeve.com> <533474AA.3020608@cs.ucla.edu> In-Reply-To: <533474AA.3020608@cs.ucla.edu> X-Enigmail-Version: 1.6 OpenPGP: url=http://people.redhat.com/eblake/eblake.gpg Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="I57T9IkgFnEOnN3AdVxpKui88rHbvfLgj" X-Scanned-By: MIMEDefang 2.68 on 10.5.11.25 X-Spam-Score: -5.4 (-----) X-Debbugs-Envelope-To: 17056-done X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.4 (-----) This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --I57T9IkgFnEOnN3AdVxpKui88rHbvfLgj Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 03/27/2014 12:57 PM, Paul Eggert wrote: > On 03/27/2014 11:48 AM, Aharon Robbins wrote: >> What if >> the system's setlocale() actually returns NULL? > Then we don't know what the locale is. Perhaps setlocale ran out of > memory and so returned NULL. If so, subsequent calls might use some > weird Turkish locale with multibyte characters. So it sounds safer to > assume the worst in that case. This is in main(). POSIX guarantees that until setlocale() is called for the first time, we are in the C locale. If you were in a library, I could buy the argument of setlocale() returning NULL as indicative of some rare error. But in main(), where you are the first call, the only thing that a NULL return implies is that your attempt to change the locale had no effect, so it remains at the locale it was before, which is the C locale since all programs start in the C locale. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --I57T9IkgFnEOnN3AdVxpKui88rHbvfLgj Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJTNHZAAAoJEKeha0olJ0NqAlkH/1PmYi+BJMHnCFphELrKg/dv RDsnlZKeZXDXrvHDULWS8cGr6+08qICzEZoTfSQxhnfC/ZR64npgbZRIKBuh6vB2 HIkG/72e9DIDKVrJPM8FD6MCf6bzFqqAMC+gC7aHUYr6iuCx9H/xop2ZmhXbUTl8 tsUojG0wIac1MiRIkt08jmk9i0bkL25HOnk2cmTMHXV1j+7aOno8Y8i6VvgHuiF/ 56EMru+fgveTj1xj7fGBqLWYUMa/JacMA5arlY4dKM9rjzmSOhX6aC1/RNnTBS6m NpoxxIW5Y1ow3boMntyLx2OBMoG6xZzvnof7znTQCTkmA4ZTpGvOdffG+0MiuMc= =wEAR -----END PGP SIGNATURE----- --I57T9IkgFnEOnN3AdVxpKui88rHbvfLgj-- From debbugs-submit-bounces@debbugs.gnu.org Fri Mar 28 06:32:41 2014 Received: (at 17056-done) by debbugs.gnu.org; 28 Mar 2014 10:32:41 +0000 Received: from localhost ([127.0.0.1]:53951 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WTU5Y-0006qz-M6 for submit@debbugs.gnu.org; Fri, 28 Mar 2014 06:32:40 -0400 Received: from mxout2.netvision.net.il ([194.90.9.21]:36442) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WTU5W-0006qn-Mi for 17056-done@debbugs.gnu.org; Fri, 28 Mar 2014 06:32:39 -0400 MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; CHARSET=US-ASCII Received: from skeeve.com ([46.116.115.46]) by mxout2.netvision.net.il (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPS id <0N35003II6JKGGL0@mxout2.netvision.net.il> for 17056-done@debbugs.gnu.org; Fri, 28 Mar 2014 13:30:57 +0300 (IDT) Received: from skeeve.com (skeeve.com [127.0.0.1]) by skeeve.com (8.14.4/8.14.4/Debian-2ubuntu2.1) with ESMTP id s2SAUtFB027567; Fri, 28 Mar 2014 13:30:55 +0300 Received: (from arnold@localhost) by skeeve.com (8.14.4/8.14.4/Submit) id s2SAUsOF027566; Fri, 28 Mar 2014 13:30:54 +0300 From: Aharon Robbins Message-id: <201403281030.s2SAUsOF027566@skeeve.com> Date: Fri, 28 Mar 2014 13:30:54 +0300 To: eggert@cs.ucla.edu, eblake@redhat.com, arnold@skeeve.com, 17056-done@debbugs.gnu.org Subject: Re: bug#17056: dfa.c patch for systems with no locale support References: <201403211140.s2LBeHJK003619@skeeve.com> <532C804B.1080008@cs.ucla.edu> <201403232001.s2NK1IDI007015@skeeve.com> <532F4F3F.3000705@cs.ucla.edu> <201403262008.s2QK8dkt031576@skeeve.com> <5333AB94.6050106@cs.ucla.edu> <201403271848.s2RImckr019893@skeeve.com> <533474AA.3020608@cs.ucla.edu> <53347640.4030409@redhat.com> In-reply-to: <53347640.4030409@redhat.com> User-Agent: Heirloom mailx 12.5 6/20/10 X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 17056-done X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) Me: > >> What if > >> the system's setlocale() actually returns NULL? Paul: > > Then we don't know what the locale is. Perhaps setlocale ran out of > > memory and so returned NULL. If so, subsequent calls might use some > > weird Turkish locale with multibyte characters. So it sounds safer to > > assume the worst in that case. Eric: > This is in main(). POSIX guarantees that until setlocale() is called > for the first time, we are in the C locale. If you were in a library, I > could buy the argument of setlocale() returning NULL as indicative of > some rare error. But in main(), where you are the first call, the only > thing that a NULL return implies is that your attempt to change the > locale had no effect, so it remains at the locale it was before, which > is the C locale since all programs start in the C locale. So, are we for or against my suggested change? Sounds like "for", but I'm not sure. Thanks, Arnold From debbugs-submit-bounces@debbugs.gnu.org Fri Mar 28 22:28:09 2014 Received: (at 17056-done) by debbugs.gnu.org; 29 Mar 2014 02:28:10 +0000 Received: from localhost ([127.0.0.1]:55299 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WTj0C-0007JX-TI for submit@debbugs.gnu.org; Fri, 28 Mar 2014 22:28:09 -0400 Received: from smtp.cs.ucla.edu ([131.179.128.62]:54971) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WTj0A-0007JP-VA for 17056-done@debbugs.gnu.org; Fri, 28 Mar 2014 22:28:07 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp.cs.ucla.edu (Postfix) with ESMTP id 2F86339E8012; Fri, 28 Mar 2014 19:28:06 -0700 (PDT) X-Virus-Scanned: amavisd-new at smtp.cs.ucla.edu Received: from smtp.cs.ucla.edu ([127.0.0.1]) by localhost (smtp.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id pZ4mkkzdnO+H; Fri, 28 Mar 2014 19:28:05 -0700 (PDT) Received: from [192.168.1.9] (pool-108-0-233-62.lsanca.fios.verizon.net [108.0.233.62]) by smtp.cs.ucla.edu (Postfix) with ESMTPSA id B913339E8011; Fri, 28 Mar 2014 19:28:05 -0700 (PDT) Message-ID: <53362FB5.5010404@cs.ucla.edu> Date: Fri, 28 Mar 2014 19:28:05 -0700 From: Paul Eggert Organization: UCLA Computer Science Department User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 MIME-Version: 1.0 To: Aharon Robbins , eblake@redhat.com, 17056-done@debbugs.gnu.org Subject: Re: bug#17056: dfa.c patch for systems with no locale support References: <201403211140.s2LBeHJK003619@skeeve.com> <532C804B.1080008@cs.ucla.edu> <201403232001.s2NK1IDI007015@skeeve.com> <532F4F3F.3000705@cs.ucla.edu> <201403262008.s2QK8dkt031576@skeeve.com> <5333AB94.6050106@cs.ucla.edu> <201403271848.s2RImckr019893@skeeve.com> <533474AA.3020608@cs.ucla.edu> <53347640.4030409@redhat.com> <201403281030.s2SAUsOF027566@skeeve.com> In-Reply-To: <201403281030.s2SAUsOF027566@skeeve.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -2.7 (--) X-Debbugs-Envelope-To: 17056-done X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.7 (--) Aharon Robbins wrote: > So, are we for or against my suggested change? Sounds like "for", Yes, thanks, it looks good. I installed it. From debbugs-submit-bounces@debbugs.gnu.org Tue Apr 01 04:18:03 2014 Received: (at 17056) by debbugs.gnu.org; 1 Apr 2014 08:18:03 +0000 Received: from localhost ([127.0.0.1]:58668 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WUttS-0003YI-6a for submit@debbugs.gnu.org; Tue, 01 Apr 2014 04:18:02 -0400 Received: from mail-wg0-f41.google.com ([74.125.82.41]:39399) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WUttQ-0003Y2-CO for 17056@debbugs.gnu.org; Tue, 01 Apr 2014 04:18:00 -0400 Received: by mail-wg0-f41.google.com with SMTP id n12so7176495wgh.24 for <17056@debbugs.gnu.org>; Tue, 01 Apr 2014 01:17:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=0z+PcfL5GNfkryVOhe0htPUUbDaCc2sorkqOGyOncVg=; b=h3ad4kRc3AE8Ky/QG6jGp/01j/otH2luXmV6xfT7wmqFDJxNoAIAyybgAICt3pkU4N hGYQBrbLz7pCJfYaT9zkwUQHUde48CkkDPGll1MwqWX+zGvJvtm3jGtwh/CgkkR6Ts7B B917PsQ7g8hN73sa6o8oFp0d17YrNQMR1tSQmRre0aAAa2grgceUuGnuWyaBso2vLjgE lfmnhH8c/BdryHwHFjabgiGI7XHm7+jL65tBAR9QSiXMlvTfXSM/JxQPcDkn2cseAhLs 7NK7+CKVls1ust5QXGZrzHSKohzwtxGscE+Ykfa8butQu6kw+c1y5L+dqjliSg+A9b2j bLAw== X-Received: by 10.194.78.77 with SMTP id z13mr11848504wjw.64.1396340279373; Tue, 01 Apr 2014 01:17:59 -0700 (PDT) Received: from yakj.usersys.redhat.com (net-37-117-156-129.cust.vodafonedsl.it. [37.117.156.129]) by mx.google.com with ESMTPSA id n41sm38861235eeg.4.2014.04.01.01.17.57 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 01 Apr 2014 01:17:58 -0700 (PDT) Message-ID: <533A7634.30501@gnu.org> Date: Tue, 01 Apr 2014 10:17:56 +0200 From: Paolo Bonzini User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 MIME-Version: 1.0 To: 17056@debbugs.gnu.org, eggert@cs.ucla.edu, arnold@skeeve.com Subject: Re: bug#17056: dfa.c patch for systems with no locale support References: <201403211140.s2LBeHJK003619@skeeve.com> <532C804B.1080008@cs.ucla.edu> <201403232001.s2NK1IDI007015@skeeve.com> <532F4F3F.3000705@cs.ucla.edu> In-Reply-To: <532F4F3F.3000705@cs.ucla.edu> X-Enigmail-Version: 1.6 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 17056 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) Il 23/03/2014 22:16, Paul Eggert ha scritto: > Aharon Robbins wrote: > >> See the original report below > > I downloaded the DJGPP sources. LC_ALL is defined unless one compiles > as a freestanding environment, in which case neither LC_ALL nor > setlocale are declared. So my guess is that your correspondent is using > a freestanding environment somehow, and the patch that I suggested > should work. It's better to avoid #ifdefs inside functions so I > installed this into the grep master (see attached) and am marking this > as done; we can always resurrect it if my guess is wrong. > I disagree with this patch. In grep, the right place to fix this should be gnulib. Unless we get a report about this bug for grep, the patch should be installed only in gawk. Paolo From unknown Sat Aug 16 21:16:48 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Tue, 29 Apr 2014 11:24:03 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator