From patchwork Thu Feb 24 21:45:46 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Carlos O'Donell X-Patchwork-Id: 1597358 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=MUISwXWM; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=8.43.85.97; helo=sourceware.org; envelope-from=libc-alpha-bounces+incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4K4RNR3vlzz9sGD for ; Fri, 25 Feb 2022 08:48:07 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 4DE6E385803E for ; Thu, 24 Feb 2022 21:48:04 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4DE6E385803E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1645739284; bh=kV9bxOKKmzefeoymYjkpugjeE4RXPtY/NyezTmCZzik=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=MUISwXWMchP5IEDmzSuMfqeYj7b+30gM2aSJ2fGP4CBtpoAEat+XneJrJ/Mtt358K 2jDasOuAQbJ1Tu+lwIuDFgVK3ajNELo63IJMJ6A00sALX80GUzBMQX4MczrhuskImr NNc9Q8TsAyP4wpy+fQFdBgEhHvr8tRBYCNriYAPI= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 4062A3947C3A for ; Thu, 24 Feb 2022 21:46:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 4062A3947C3A Received: from mail-qv1-f69.google.com (mail-qv1-f69.google.com [209.85.219.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-649-AHjy0jp7O-CpaHBczDuIbA-1; Thu, 24 Feb 2022 16:46:22 -0500 X-MC-Unique: AHjy0jp7O-CpaHBczDuIbA-1 Received: by mail-qv1-f69.google.com with SMTP id kc30-20020a056214411e00b0042cb92fe8bbso4213927qvb.8 for ; Thu, 24 Feb 2022 13:46:22 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=kV9bxOKKmzefeoymYjkpugjeE4RXPtY/NyezTmCZzik=; b=7x0YgO0yZ5YqfiSo49jSFa7H9UNGkF27f/9WIFUK3Nk+l4K/qI/Sr3x77Nz6GBb1Bk e99hiIpSTeSv+KMVZzz6FVNc8w0EVMEAUaReg0xdXluN7V9oMrowcDmywNPpwpHVRHvC 65BfvDNMIfN5+Eempfq/mkpfCXcX7Bb4309oa+S954qg5hIs/cBLe2PfQ7ir74TtrAfo YmhVM0HpGRck6nFC+QS1A6YRQzcpCzwFWQcqL7nIqDqnxQ5hzsCdFjkVXbCo0AQEkjac KNSECd26Zgb1ifTYm/lMSjoZFztf/BDez8LVNVWaQ8aK6lITrfs2a1XNA7JItPctheNV zQMg== X-Gm-Message-State: AOAM531ncFzByNv9ksYOJc6M2aFTnNBEk26xzw7Sn44PU3Tp8FYrI5BA GWis9g5twkSNILONnlIOCg9DM44HHUHKCT96dGFI7anhcP9gD1QWc7t5GrljW6ZzFwANWOkpdid J6VZPumJ8r7zLQR0+PkGvO2MGIa5spxWC0aKBjmWxMpfdD+UZWpL9ZRWKQw0FBjYrUZfvog== X-Received: by 2002:a05:620a:45:b0:508:176a:8892 with SMTP id t5-20020a05620a004500b00508176a8892mr3063066qkt.731.1645739181505; Thu, 24 Feb 2022 13:46:21 -0800 (PST) X-Google-Smtp-Source: ABdhPJwM50q6gGkX2iYf/cc3gLrSNeJf/XuATFn+CAPJf5luxe7vVtdZjY0hUQ+M4E3hx09nyz2xDg== X-Received: by 2002:a05:620a:45:b0:508:176a:8892 with SMTP id t5-20020a05620a004500b00508176a8892mr3063040qkt.731.1645739180986; Thu, 24 Feb 2022 13:46:20 -0800 (PST) Received: from athas.redhat.com (135-23-175-80.cpe.pppoe.ca. [135.23.175.80]) by smtp.gmail.com with ESMTPSA id f7-20020a05622a104700b002d4b318692esm316117qte.31.2022.02.24.13.46.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Feb 2022 13:46:20 -0800 (PST) To: libc-alpha@sourceware.org, dj@redhat.com Subject: [PATCH v2 1/2] localedef: Update LC_MONETARY handling (Bug 28845) Date: Thu, 24 Feb 2022 16:45:46 -0500 Message-Id: <20220224214547.911386-2-carlos@redhat.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220224214547.911386-1-carlos@redhat.com> References: <20220224214547.911386-1-carlos@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-11.7 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H5, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Carlos O'Donell via Libc-alpha From: Carlos O'Donell Reply-To: Carlos O'Donell Errors-To: libc-alpha-bounces+incoming=patchwork.ozlabs.org@sourceware.org Sender: "Libc-alpha" ISO C17, POSIX Issue 7, and ISO 30112 all allow the char* types to be empty strings i.e. "", integer or char values to be -1 or CHAR_MAX respectively, with the exception of decimal_point which must be non-empty in ISO C. Note that the defaults for mon_grouping vary, but are functionaly equivalent e.g. "\177" (no further grouping reuqired) vs. "" (no grouping defined for all groups). We include a broad comment talking about harmonizing ISO C, POSIX, ISO 30112, and the default C/POSIX locale for glibc. We reorder all setting based on locale/categories.def order. We soften all missing definitions from errors to warnings when defaults exist. Given that ISO C, POSIX and ISO 30112 allow the empty string we change LC_MONETARY handling of mon_decimal_point to allow the empty string. If mon_decimal_point is not defined at all then we pick the existing legacy glibc default value of i.e. ".". We also set the default for mon_thousands_sep_wc at the same time as mon_thousands_sep, but this is not a change in behaviour, it is always either a matching value or L'\0', but if in the future we change the default to a non-empty string we would need to update both at the same time. Tested on x86_64 and i686 without regressions. Tested with install-locale-archive target. Tested with install-locale-files target. Reviewed-by: DJ Delorie --- locale/programs/ld-monetary.c | 182 +++++++++++++++++++++++++++------- 1 file changed, 146 insertions(+), 36 deletions(-) diff --git a/locale/programs/ld-monetary.c b/locale/programs/ld-monetary.c index 3b0412b405..e78f40ffb4 100644 --- a/locale/programs/ld-monetary.c +++ b/locale/programs/ld-monetary.c @@ -196,21 +196,105 @@ No definition for %s category found"), "LC_MONETARY"); } } + /* Generally speaking there are 3 standards the define the default, + warning, and error behaviour of LC_MONETARY. They are ISO/IEC TR 30112, + ISO/IEC 9899:2018 (ISO C17), and POSIX.1-2017. Within 30112 we have the + definition of a standard i18n FDCC-set, which for LC_MONETARY has the + following default values: + int_curr_symbol "" + currency_symbol "" + mon_decimal_point "" i.e. "," + mon_thousand_sep "" + mon_grouping "\177" i.e. terminating -1 + positive_sign "" + negative_sign "" i.e. "." + int_frac_digits -1 + frac_digits -1 + p_cs_precedes -1 + p_sep_by_space -1 + n_cs_precedes -1 + n_sep_by_space -1 + p_sign_posn -1 + n_sign_posn -1 + Under 30112 a keyword that is not provided implies an empty string "" + for string values or a -1 for integer values, and indicates the value + is unspecified with no default implied. No errors are considered. + The exception is mon_grouping which is a string with a terminating + CHAR_MAX. + For POSIX Issue 7 we have: + https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap07.html + and again values not provided default to "" or -1, and indicate the value + is not available to the locale. The exception is mon_grouping which is + a string with a terminating CHAR_MAX. For the POSIX locale the values of + LC_MONETARY should be: + int_curr_symbol "" + currency_symbol "" + mon_decimal_point "" + mon_thousands_sep "" + mon_grouping "\177" i.e. terminating -1 + positive_sign "" + negative_sign "" + int_frac_digits -1 + frac_digits -1 + p_cs_precedes -1 + p_sep_by_space -1 + n_cs_precedes -1 + n_sep_by_space -1 + p_sign_posn -1 + n_sign_posn -1 + int_p_cs_precedes -1 + int_p_sep_by_space -1 + int_n_cs_precedes -1 + int_n_sep_by_space -1 + int_p_sign_posn -1 + int_n_sign_posn -1 + Like with 30112, POSIX also considers no error if the keywords are + missing, only that if the cateory as a whole is missing the referencing + of the category results in unspecified behaviour. + For ISO C17 there is no default value provided, but the localeconv + specification in 7.11.2.1 admits that members of char * type may point + to "" to indicate a value is not available or is of length zero. + The exception is decimal_point (not mon_decimal_point) which must be a + defined non-empty string. The values of char, which are generally + mapped to integer values in 30112 and POSIX, must be non-negative + numbers that map to CHAR_MAX when a value is not available in the + locale. + In ISO C17 for the "C" locale all values are empty strings "", or + CHAR_MAX, with the exception of decimal_point which is "." (defined + in LC_NUMERIC). ISO C17 makes no exception for mon_grouping like + 30112 and POSIX, but a value of "" is functionally equivalent to + "\177" since neither defines a grouping (though the latter terminates + the grouping). + + Lastly, we must consider the legacy C/POSIX locale that implemented + as a builtin in glibc and wether a default value mapping to the + C/POSIX locale may benefit the user from a compatibility perspective. + + Thus given 30112, POSIX, ISO C, and the builtin C/POSIX locale we + need to pick appropriate defaults below. */ + + /* The members of LC_MONETARY are handled in the order of their definition + in locale/categories.def. Please keep them in that order. */ + + /* The purpose of TEST_ELEM is to define a default value for the fields + in the category if the field was not defined in the cateory. If the + category was present but we didn't see a definition for the field then + we also issue a warning, otherwise the only warning you get is the one + earlier when a default category is created (completely missing category). + This missing field warning is glibc-specific since no standard requires + this warning, but we consider it valuable to print a warning for all + missing fields in the category. */ #define TEST_ELEM(cat, initval) \ if (monetary->cat == NULL) \ { \ if (! nothing) \ - record_error (0, 0, _("%s: field `%s' not defined"), \ - "LC_MONETARY", #cat); \ + record_warning (_("%s: field `%s' not defined"), \ + "LC_MONETARY", #cat); \ monetary->cat = initval; \ } + /* Keyword: int_curr_symbol. */ TEST_ELEM (int_curr_symbol, ""); - TEST_ELEM (currency_symbol, ""); - TEST_ELEM (mon_thousands_sep, ""); - TEST_ELEM (positive_sign, ""); - TEST_ELEM (negative_sign, ""); - /* The international currency symbol must come from ISO 4217. */ if (monetary->int_curr_symbol != NULL) { @@ -247,41 +331,63 @@ not correspond to a valid name in ISO 4217 [--no-warnings=intcurrsym]"), } } - /* The decimal point must not be empty. This is not said explicitly - in POSIX but ANSI C (ISO/IEC 9899) says in 4.4.2.1 it has to be - != "". */ + /* Keyword: currency_symbol */ + TEST_ELEM (currency_symbol, ""); + + /* Keyword: mon_decimal_point */ + /* ISO C17 7.11.2.1.3 explicitly allows mon_decimal_point to be the + empty string e.g. "". This indicates the value is not available in the + current locale or is of zero length. However, if the value was never + defined then we issue a warning and use a glibc-specific default. ISO + 30112 in the i18n FDCC-Set uses ",", and POSIX Issue 7 in the + POSIX locale uses "". It is specific to glibc that the default is + "."; we retain this existing behaviour for backwards compatibility. */ if (monetary->mon_decimal_point == NULL) { if (! nothing) - record_error (0, 0, _("%s: field `%s' not defined"), - "LC_MONETARY", "mon_decimal_point"); + record_warning (_("%s: field `%s' not defined, using defaults"), + "LC_MONETARY", "mon_decimal_point"); monetary->mon_decimal_point = "."; monetary->mon_decimal_point_wc = L'.'; } - else if (monetary->mon_decimal_point[0] == '\0' && ! be_quiet && ! nothing) + + /* Keyword: mon_thousands_sep */ + if (monetary->mon_thousands_sep == NULL) { - record_error (0, 0, _("\ -%s: value for field `%s' must not be an empty string"), - "LC_MONETARY", "mon_decimal_point"); + if (! nothing) + record_warning (_("%s: field `%s' not defined, using defaults"), + "LC_MONETARY", "mon_thousands_sep"); + monetary->mon_thousands_sep = ""; + monetary->mon_thousands_sep_wc = L'\0'; } + /* Keyword: mon_grouping */ if (monetary->mon_grouping_len == 0) { if (! nothing) - record_error (0, 0, _("%s: field `%s' not defined"), - "LC_MONETARY", "mon_grouping"); - + record_warning (_("%s: field `%s' not defined"), + "LC_MONETARY", "mon_grouping"); + /* Missing entries are given 1 element in their bytearray with + a value of CHAR_MAX which indicates that "No further grouping + is to be performed" (functionally equivalent to ISO C's "C" + locale default of ""). */ monetary->mon_grouping = (char *) "\177"; monetary->mon_grouping_len = 1; } + /* Keyword: positive_sign */ + TEST_ELEM (positive_sign, ""); + + /* Keyword: negative_sign */ + TEST_ELEM (negative_sign, ""); + #undef TEST_ELEM #define TEST_ELEM(cat, min, max, initval) \ if (monetary->cat == -2) \ { \ if (! nothing) \ - record_error (0, 0, _("%s: field `%s' not defined"), \ - "LC_MONETARY", #cat); \ + record_warning (_("%s: field `%s' not defined"), \ + "LC_MONETARY", #cat); \ monetary->cat = initval; \ } \ else if ((monetary->cat < min || monetary->cat > max) \ @@ -300,16 +406,11 @@ not correspond to a valid name in ISO 4217 [--no-warnings=intcurrsym]"), TEST_ELEM (p_sign_posn, -1, 4, -1); TEST_ELEM (n_sign_posn, -1, 4, -1); - /* The non-POSIX.2 extensions are optional. */ - if (monetary->duo_int_curr_symbol == NULL) - monetary->duo_int_curr_symbol = monetary->int_curr_symbol; - if (monetary->duo_currency_symbol == NULL) - monetary->duo_currency_symbol = monetary->currency_symbol; - - if (monetary->duo_int_frac_digits == -2) - monetary->duo_int_frac_digits = monetary->int_frac_digits; - if (monetary->duo_frac_digits == -2) - monetary->duo_frac_digits = monetary->frac_digits; + /* Keyword: crncystr */ + monetary->crncystr = (char *) xmalloc (strlen (monetary->currency_symbol) + + 2); + monetary->crncystr[0] = monetary->p_cs_precedes ? '-' : '+'; + strcpy (&monetary->crncystr[1], monetary->currency_symbol); #undef TEST_ELEM #define TEST_ELEM(cat, alt, min, max) \ @@ -327,6 +428,17 @@ not correspond to a valid name in ISO 4217 [--no-warnings=intcurrsym]"), TEST_ELEM (int_p_sign_posn, p_sign_posn, -1, 4); TEST_ELEM (int_n_sign_posn, n_sign_posn, -1, 4); + /* The non-POSIX.2 extensions are optional. */ + if (monetary->duo_int_curr_symbol == NULL) + monetary->duo_int_curr_symbol = monetary->int_curr_symbol; + if (monetary->duo_currency_symbol == NULL) + monetary->duo_currency_symbol = monetary->currency_symbol; + + if (monetary->duo_int_frac_digits == -2) + monetary->duo_int_frac_digits = monetary->int_frac_digits; + if (monetary->duo_frac_digits == -2) + monetary->duo_frac_digits = monetary->frac_digits; + TEST_ELEM (duo_p_cs_precedes, p_cs_precedes, -1, 1); TEST_ELEM (duo_p_sep_by_space, p_sep_by_space, -1, 2); TEST_ELEM (duo_n_cs_precedes, n_cs_precedes, -1, 1); @@ -349,17 +461,15 @@ not correspond to a valid name in ISO 4217 [--no-warnings=intcurrsym]"), if (monetary->duo_valid_to == 0) monetary->duo_valid_to = 99991231; + /* Keyword: conversion_rate */ if (monetary->conversion_rate[0] == 0) { monetary->conversion_rate[0] = 1; monetary->conversion_rate[1] = 1; } - /* Create the crncystr entry. */ - monetary->crncystr = (char *) xmalloc (strlen (monetary->currency_symbol) - + 2); - monetary->crncystr[0] = monetary->p_cs_precedes ? '-' : '+'; - strcpy (&monetary->crncystr[1], monetary->currency_symbol); + /* A value for monetary-decimal-point-wc was set when + monetary_decimal_point was set, likewise for monetary-thousands-sep-wc. */ } From patchwork Thu Feb 24 21:45:47 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Carlos O'Donell X-Patchwork-Id: 1597357 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=I4p6djvF; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=libc-alpha-bounces+incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4K4RMc2zw4z9sGD for ; Fri, 25 Feb 2022 08:47:24 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 4BF6C385802A for ; Thu, 24 Feb 2022 21:47:22 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4BF6C385802A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1645739242; bh=jBXgVh6kM7V4ytu8dlrK41asw8gYrrzCoa+W5NnVvUw=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=I4p6djvFa7lB4FjJSRNTvTN9mqFllAJvbY9PzpQV+ucmgvrZ7Bgx7NVQcIB49jhJ4 FR2IGDJOKmIWRDPoUjJJTcs9K94ooKB3oTyvIv36+/UGbxskNF7uFQ2JUKPrJZgf+Z ik5APR9cHR4tyfkX9qGpEG1b3GyLHnEZBbHqZqnk= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 9F9753948450 for ; Thu, 24 Feb 2022 21:46:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 9F9753948450 Received: from mail-qv1-f71.google.com (mail-qv1-f71.google.com [209.85.219.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-647-Y6RlVWlFOxCteZLymEVysw-1; Thu, 24 Feb 2022 16:46:23 -0500 X-MC-Unique: Y6RlVWlFOxCteZLymEVysw-1 Received: by mail-qv1-f71.google.com with SMTP id kl13-20020a056214518d00b0042cb237f86bso4305487qvb.0 for ; Thu, 24 Feb 2022 13:46:23 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=jBXgVh6kM7V4ytu8dlrK41asw8gYrrzCoa+W5NnVvUw=; b=Q28MjDJNlyciPscft725rk6ANygmbfdh1nGVTwa2u33GvXQsTdAtbnRisnIDg1maXv 3YZpcsFBSDv7yBFs4vm2ER8FmGjeMpgoCS7oqOSde6btGJhmYcp4oSmXvckaK9I/oZEe YjztYh3qs0zkoUZHGOCC1cx1Lvck3009Xj4uJuv2hShhj88ZbHhh7/X8LGECZfZqdwsy 6SQk2bxB25gBP8tFOJRDQ6aKieUYhiblFbOK7VGU+Lx+kGAfZR3crpGe4K7qtGYBRpFa asapV88zQrMoAnk/4+PtWk/kxjeCOEEbSuu4cFh8v5gZQDh10jbeo7bly7vrJSk3OQWc xy4g== X-Gm-Message-State: AOAM531feBe++RpnJs7FkMJukbHqcqFNgb1WWxEyG1/SijTt+6L5Rhue ORoh2qoE0/UTXXaw8UZ1p/8fw24Rmjv9FsDzzfr4goGeVNBFInjU2R3Kf2nGrj+vIENdAqjpyRd 9wguw6XmXPjQEpXGIBbA0LTIJpLRFF7Lu19QxwBdU7E1bJVaDDxYBTkFTVr5i+C2NKxL2rw== X-Received: by 2002:ae9:e501:0:b0:62c:efb6:bbfe with SMTP id w1-20020ae9e501000000b0062cefb6bbfemr3054445qkf.429.1645739183093; Thu, 24 Feb 2022 13:46:23 -0800 (PST) X-Google-Smtp-Source: ABdhPJwp19fNzFLlHAf/7sKKzyO0CUuTKtRh0JpDeOP6kCFdCEjvqt4st5lJKZq1mnSSUy8b1Xn39Q== X-Received: by 2002:ae9:e501:0:b0:62c:efb6:bbfe with SMTP id w1-20020ae9e501000000b0062cefb6bbfemr3054427qkf.429.1645739182818; Thu, 24 Feb 2022 13:46:22 -0800 (PST) Received: from athas.redhat.com (135-23-175-80.cpe.pppoe.ca. [135.23.175.80]) by smtp.gmail.com with ESMTPSA id f7-20020a05622a104700b002d4b318692esm316117qte.31.2022.02.24.13.46.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Feb 2022 13:46:22 -0800 (PST) To: libc-alpha@sourceware.org, dj@redhat.com Subject: [PATCH v2 2/2] localedata: Do not generate output if warnings were present. Date: Thu, 24 Feb 2022 16:45:47 -0500 Message-Id: <20220224214547.911386-3-carlos@redhat.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220224214547.911386-1-carlos@redhat.com> References: <20220224214547.911386-1-carlos@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-11.7 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H5, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Carlos O'Donell via Libc-alpha From: Carlos O'Donell Reply-To: Carlos O'Donell Errors-To: libc-alpha-bounces+incoming=patchwork.ozlabs.org@sourceware.org Sender: "Libc-alpha" With LC_MONETARY parsing fixed we can now generate locales without forcing output with '-c'. Removing '-c' from localedef invocation is the equivalent of using -Werror for localedef. The glibc locale sources should always be clean and free from warnings. We remove '-c' from both test locale generation and the targets used for installing locales e.g. install-locale-archive, and install-locale-files. Tested on x86_64 and i686 without regressions. Tested with install-locale-archive target. Tested with install-locale-files target. Reviewed-by: DJ Delorie --- localedata/Makefile | 4 ++-- localedata/gen-locale.sh | 10 ++++++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/localedata/Makefile b/localedata/Makefile index 9ae2e5c161..7741ac3b5e 100644 --- a/localedata/Makefile +++ b/localedata/Makefile @@ -468,11 +468,11 @@ define build-one-locale endef $(INSTALL-SUPPORTED-LOCALE-ARCHIVE): install-locales-dir - @flags="-c"; \ + @flags=""; \ $(build-one-locale) $(INSTALL-SUPPORTED-LOCALE-FILES): install-locales-dir - @flags="-c --no-archive --no-hard-links"; \ + @flags="--no-archive --no-hard-links"; \ $(build-one-locale) tst-setlocale-ENV = LC_ALL=ja_JP.EUC-JP diff --git a/localedata/gen-locale.sh b/localedata/gen-locale.sh index 7fce35f212..8053c816a6 100644 --- a/localedata/gen-locale.sh +++ b/localedata/gen-locale.sh @@ -54,8 +54,14 @@ modifier=`echo $locfile|sed 's|[^.]*[.]\([^@ ]*\)\(@[^ ]*\)\?/LC_CTYPE|\2|'` echo "Generating locale $locale.$charmap: this might take a while..." -# Run quietly and force output. -flags="--quiet -c" +# Do not force output with '-c', all locales should compile without +# warning or errors. There is likewise no need to run quietly with +# '--quiet' since all locales should compile without additional +# diagnostics. If there are messages printed then we want to see +# them, fix them, and the associated error or warning. During +# development it may be beneficialy to put '--quiet -c' here to allow +# you to develop in-progress locales. +flags="" # For SJIS the charmap is SHIFT_JIS. We just want the locale to have # a slightly nicer name instead of using "*.SHIFT_SJIS", but that