From patchwork Thu Mar 21 20:47:24 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Gabriel F. T. Gomes" X-Patchwork-Id: 31937 Received: (qmail 113333 invoked by alias); 21 Mar 2019 20:47:40 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 113320 invoked by uid 89); 21 Mar 2019 20:47:39 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-13.9 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3 autolearn=ham version=3.3.1 spammy=gabriel, Gabriel, consists, H*F:D*br X-HELO: smtpout1.mo528.mail-out.ovh.net Date: Thu, 21 Mar 2019 17:47:24 -0300 From: "Gabriel F. T. Gomes" To: DJ Delorie CC: Carlos O'Donell , , Subject: Re: bz1311954 - multilib variations in LC_COLLATE files, with fixes Message-ID: <20190321174724.72b87ae9@tereshkova.br.ibm.com> In-Reply-To: References: <4821cd97-48b0-9d37-58b0-0333e53bc0bd@redhat.com> MIME-Version: 1.0 X-Ovh-Tracer-Id: 17898993772928356083 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedutddrieelgdduvdeiucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucesvcftvggtihhpihgvnhhtshculddquddttddm On Thu, 21 Mar 2019, DJ Delorie wrote: >"Carlos O'Donell" writes: >> This is a user-visible bug and so needs a bugzilla entry, please create >> one, and reference the ml discussion, and reference it here. >> >> OK for master with changelog that refs the bug # and commit first line >> that refs the bug #. > >Done: https://sourceware.org/bugzilla/show_bug.cgi?id=24372 I have seen builds errors on powerppc after this patch. The following patch fixes them... OK for master? From a1a766ed231b2a01e0a2adad2982fc529ce9ca2d Mon Sep 17 00:00:00 2001 From: "Gabriel F. T. Gomes" Date: Thu, 21 Mar 2019 17:24:30 -0300 Subject: [PATCH] Fix parentheses error in iconvconfig.c and ld-collate.c MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When -Werror=parentheses is in use, iconvconfig.c builds fail with: iconvconfig.c: In function ‘write_output’: iconvconfig.c:1084:34: error: suggest parentheses around ‘+’ inside ‘>>’ [-Werror=parentheses] hash_size = next_prime (nnames + nnames >> 1); ~~~~~~~^~~~~~~~ This patch adds parentheses to the expression. Not where suggested by the compiler warning, but where it produces the expected result, i.e.: where it has the effect of multiplying nnames by 1.5. Likewise for elem_size in ld-collate.c. Tested for powerpc64le. * iconv/iconvconfig.c (write_output): Add parentheses to get rid of compiler warning. * locale/programs/ld-collate.c (collate_output): Likewise. Reviewed-by: Carlos O'Donell --- iconv/iconvconfig.c | 2 +- locale/programs/ld-collate.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/iconv/iconvconfig.c b/iconv/iconvconfig.c index 1e6066cdf0..f75e46dc16 100644 --- a/iconv/iconvconfig.c +++ b/iconv/iconvconfig.c @@ -1081,7 +1081,7 @@ write_output (void) Creating a perfect hash table is not reasonable here. Therefore we use open hashing and a table size which is the next prime 50% larger than the number of strings. */ - hash_size = next_prime (nnames + nnames >> 1); + hash_size = next_prime (nnames + (nnames >> 1)); hash_table = (struct hash_entry *) xcalloc (hash_size, sizeof (struct hash_entry)); /* Fill the hash table. */ diff --git a/locale/programs/ld-collate.c b/locale/programs/ld-collate.c index 19b23c2453..6baab6cfb0 100644 --- a/locale/programs/ld-collate.c +++ b/locale/programs/ld-collate.c @@ -2402,7 +2402,7 @@ collate_output (struct localedef_t *locale, const struct charmap_t *charmap, runp = runp->next; } /* Add 50% and find the next prime number. */ - elem_size = next_prime (elem_size + elem_size >> 1); + elem_size = next_prime (elem_size + (elem_size >> 1)); /* Allocate the table. Each entry consists of two words: the hash value and an index in a secondary table which provides the index