From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 61256 invoked by alias); 25 Jul 2017 07:06:05 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Received: (qmail 59908 invoked by uid 89); 25 Jul 2017 07:06:04 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 spammy= X-HELO: homiemail-a52.g.dreamhost.com Subject: Re: libc-2.25.90.pot To: Paul Eggert , Adhemerval Zanella , Benno Schulenberg , libc-alpha@sourceware.org Cc: Time Zone Mailing List References: <8b9b4e60-f580-e56a-26bc-adb7192ba779@sourceware.org> <6e7f7602-3536-2edb-0cf4-e66a948fdb71@translationproject.org> <9b1396c9-dd87-5627-6a26-3d6be03cb1df@cs.ucla.edu> From: Siddhesh Poyarekar Message-ID: <4e8a44a4-08a5-4475-6cd3-48a8ecf59240@gotplt.org> Date: Tue, 25 Jul 2017 10:23:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <9b1396c9-dd87-5627-6a26-3d6be03cb1df@cs.ucla.edu> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2017-07/txt/msg00841.txt.bz2 I've applied this to glibc. Siddhesh On Friday 21 July 2017 01:11 AM, Paul Eggert wrote: > On 07/20/2017 07:57 AM, Siddhesh Poyarekar wrote: >> Oh I meant PRIdLINENO, not PRIdMAX. I suppose using PRIdMAX directly >> might work since gettext seems to recognize the other PRI* macros. > > Yes, PRIdMAX should work. The zic.c code uses the macro (as opposed to > just %jd) to be portable to pre-C99 libraries. I installed the attached > patch into the upstream tzdb sources; the zic.c part of it should work > for glibc too. Thanks for reporting the problem. > > > 0001-Fix-zic.c-incompatibility-with-xgettext.patch > > > From fd13571c626bac8f5bb90ad79543cefae0fef134 Mon Sep 17 00:00:00 2001 > From: Paul Eggert > Date: Thu, 20 Jul 2017 12:34:12 -0700 > Subject: [PATCH] Fix zic.c incompatibility with xgettext > > Problem reported by Benno Schulenberg in: > https://sourceware.org/ml/libc-alpha/2017-07/msg00653.html > * NEWS: Document this. > * zic.c (PRIdLINENO): Remove. All uses replaced with definiens. > --- > NEWS | 3 +++ > zic.c | 11 ++++++----- > 2 files changed, 9 insertions(+), 5 deletions(-) > > diff --git a/NEWS b/NEWS > index 5f79225..64d5c91 100644 > --- a/NEWS > +++ b/NEWS > @@ -102,6 +102,9 @@ Unreleased, experimental changes > Calculation of time_t extrema works around a bug in GCC 4.8.4 > (Reported by Stan Shebs and Joseph Myers.) > > + zic.c no longer mistranslates formats of line numbers in non-English > + locales. (Problem reported by Benno Schulenberg.) > + > Several minor changes have been made to the code to make it a > bit easier to port to MS-Windows and Solaris. (Thanks to Kees > Dekker for reporting the problems.) > diff --git a/zic.c b/zic.c > index 300d563..765fe7d 100644 > --- a/zic.c > +++ b/zic.c > @@ -58,9 +58,10 @@ typedef int_fast64_t zic_t; > static ptrdiff_t const PTRDIFF_MAX = MAXVAL(ptrdiff_t, TYPE_BIT(ptrdiff_t)); > #endif > > -/* The type and printf format for line numbers. */ > +/* The type for line numbers. Use PRIdMAX to format them; formerly > + there was also "#define PRIdLINENO PRIdMAX" and formats used > + PRIdLINENO, but xgettext cannot grok that. */ > typedef intmax_t lineno; > -#define PRIdLINENO PRIdMAX > > struct rule { > const char * r_filename; > @@ -499,10 +500,10 @@ verror(const char *const string, va_list args) > ** on BSD systems. > */ > if (filename) > - fprintf(stderr, _("\"%s\", line %"PRIdLINENO": "), filename, linenum); > + fprintf(stderr, _("\"%s\", line %"PRIdMAX": "), filename, linenum); > vfprintf(stderr, string, args); > if (rfilename != NULL) > - fprintf(stderr, _(" (rule from \"%s\", line %"PRIdLINENO")"), > + fprintf(stderr, _(" (rule from \"%s\", line %"PRIdMAX")"), > rfilename, rlinenum); > fprintf(stderr, "\n"); > } > @@ -1264,7 +1265,7 @@ _("\"Zone %s\" line and -p option are mutually exclusive"), > if (zones[i].z_name != NULL && > strcmp(zones[i].z_name, fields[ZF_NAME]) == 0) { > error(_("duplicate zone name %s" > - " (file \"%s\", line %"PRIdLINENO")"), > + " (file \"%s\", line %"PRIdMAX")"), > fields[ZF_NAME], > zones[i].z_filename, > zones[i].z_linenum); >