From patchwork Sun Mar 29 13:25:35 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Seiderer X-Patchwork-Id: 1263438 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=busybox.net (client-ip=140.211.166.133; helo=hemlock.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=gmx.net Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; secure) header.d=gmx.net header.i=@gmx.net header.a=rsa-sha256 header.s=badeba3b8450 header.b=PC0kwB8i; dkim-atps=neutral Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 48qxDl3zs7z9sRR for ; Mon, 30 Mar 2020 00:25:59 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id A65B88831F; Sun, 29 Mar 2020 13:25:56 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id n+vU4YAoOD4A; Sun, 29 Mar 2020 13:25:55 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id 21F47882BB; Sun, 29 Mar 2020 13:25:55 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id ACA251BF28B for ; Sun, 29 Mar 2020 13:25:44 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id A9EA786BE1 for ; Sun, 29 Mar 2020 13:25:44 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id xYmnKN-llFPh for ; Sun, 29 Mar 2020 13:25:42 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mout.gmx.net (mout.gmx.net [212.227.15.18]) by whitealder.osuosl.org (Postfix) with ESMTPS id 0D5328761E for ; Sun, 29 Mar 2020 13:25:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1585488338; bh=gpGJD9exa5z46bFYwJaX5x3tsf6DVsLlO3/vLmtT61g=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=PC0kwB8ipAu3TkMdOQEdASDjWz605jWAjRE8aNviCDw6494yblJCJivsaWDFzFiOE C+nQbSw/38WsNYzInDHw/aeG89o5crBsU/qhqPjNW7opt+DsvWPNcpqr2XzIwYlJCR Uc7PuVF42618uJA6ZCduXm6yvcCYPQxEWS7gQWZ0= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from localhost.fritz.box ([62.216.209.1]) by mail.gmx.com (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MoO6M-1iybL01Xc8-00on8o; Sun, 29 Mar 2020 15:25:38 +0200 From: Peter Seiderer To: buildroot@busybox.net Date: Sun, 29 Mar 2020 15:25:35 +0200 Message-Id: <20200329132535.4811-6-ps.report@gmx.net> X-Mailer: git-send-email 2.26.0 In-Reply-To: <20200329132535.4811-1-ps.report@gmx.net> References: <20200329132535.4811-1-ps.report@gmx.net> MIME-Version: 1.0 X-Provags-ID: V03:K1:gvUbOn1eHwLDdDFw4dAqIDo6eB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Wgyk7lfg1hXve01AR3BjsLqqdehFd1o6NmX/xmcyH9rB/t9v/fN+ tnKRzhweM+Sd/731LrZu2+Exm8sRqRQiZoVmkLnC5tkOhdAYz+VZwnSkp3KMbP67cgk9m8Cb1 xErhnT1FDs3YV6k/NddtrWIHePjNpknY7VeJO2uyab6YpRSi3oH8haSg1aVZNN0gUEVhrYoR7 OCOhqwEXF2eXR8GCx3z9mAcYKZtV0Q23rJk2B0twk/c8YsfCsaJowHy1JNvkCnuAIaP6gyUkU 7qTBgHskD3VfphWazefQPF/+UIp6avI2FV+aPZiW3dn/9FEKz1SR9C1CMuRkG9ILBgT5u40nA AZWmrkKt9T6uEXFnUMN8+J2AhfDZigtDhfxdygw1/9dUXvqjrYj9jJm3rMNxbx9z8OrvhW1nE a7dkhF+nSUpdP1TXr Subject: [Buildroot] [PATCH v1 6/6] package/localedef: fix gcc-10.0.1 compile X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Maxime Hadjinlian , Martin Bark , Mahyar Koshkouei , Thomas Petazzoni , Arthur Courtel Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Fixes bug 12711 ([1]): programs/ld-ctype.c:855:18: error: array subscript 0 is outside the bounds of an interior zero-length array ‘unsigned char[0]’ [-Werror=zero-length-bounds] 855 | replace[0].bytes[0] = '?'; | ~~~~~~~~~~~~~~~~^~~ [1] https://bugs.busybox.net/show_bug.cgi?id=12711 Signed-off-by: Peter Seiderer --- Notes: Patch suggested by Yann E, MORIN, could not test personally (no gcc-10.0.1 available). --- ...itializer-for-flexible-array-member-.patch | 81 +++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 package/localedef/2.30-20-g50f20fe506abb8853641006a7b90a81af21d7b91/0003-localedef-Use-initializer-for-flexible-array-member-.patch diff --git a/package/localedef/2.30-20-g50f20fe506abb8853641006a7b90a81af21d7b91/0003-localedef-Use-initializer-for-flexible-array-member-.patch b/package/localedef/2.30-20-g50f20fe506abb8853641006a7b90a81af21d7b91/0003-localedef-Use-initializer-for-flexible-array-member-.patch new file mode 100644 index 0000000000..93547e08f0 --- /dev/null +++ b/package/localedef/2.30-20-g50f20fe506abb8853641006a7b90a81af21d7b91/0003-localedef-Use-initializer-for-flexible-array-member-.patch @@ -0,0 +1,81 @@ +From 6fea0a8e33760258c4baa5d0a6f3a145897427fe Mon Sep 17 00:00:00 2001 +From: Florian Weimer +Date: Tue, 3 Sep 2019 14:01:39 +0200 +Subject: [PATCH] localedef: Use initializer for flexible array member [BZ + #24950] + +struct charseq used a zero-length array instead of a flexible array +member. This required a strange construct to initialize struct +charseq objects, and GCC 10 warns about that: + +cc1: error: writing 1 byte into a region of size 0 [-Werror=stringop-overflow=] +In file included from programs/repertoire.h:24, + from programs/localedef.h:32, + from programs/ld-ctype.c:35: +programs/charmap.h:63:17: note: destination object declared here + 63 | unsigned char bytes[0]; + | ^~~~~ +cc1: error: writing 1 byte into a region of size 0 [-Werror=stringop-overflow=] +programs/charmap.h:63:17: note: destination object declared here +cc1: error: writing 1 byte into a region of size 0 [-Werror=stringop-overflow=] +programs/charmap.h:63:17: note: destination object declared here +cc1: error: writing 1 byte into a region of size 0 [-Werror=stringop-overflow=] +programs/charmap.h:63:17: note: destination object declared here + +The change makes the object physically const, but it is not expected +to be modified. + +[Upstream: https://sourceware.org/git/?p=glibc.git;a=patch;h=1471fa556afb428c4a4c46cf5543a4101d5bcf91] +[Dropped confliciting ChangeLog part] +Signed-off-by: Peter Seiderer +--- + locale/programs/charmap.h | 2 +- + locale/programs/ld-ctype.c | 12 ++++++------ + 2 files changed, 7 insertions(+), 7 deletions(-) + +diff --git a/locale/programs/charmap.h b/locale/programs/charmap.h +index 870a9e95..70db330d 100644 +--- a/locale/programs/charmap.h ++++ b/locale/programs/charmap.h +@@ -60,7 +60,7 @@ struct charseq + const char *name; + uint32_t ucs4; + int nbytes; +- unsigned char bytes[0]; ++ unsigned char bytes[]; + }; + + +diff --git a/locale/programs/ld-ctype.c b/locale/programs/ld-ctype.c +index cfc9c43f..9123f64a 100644 +--- a/locale/programs/ld-ctype.c ++++ b/locale/programs/ld-ctype.c +@@ -842,8 +842,6 @@ no input digits defined and none of the standard names in the charmap")); + for (cnt = 0; cnt < 10; ++cnt) + if (ctype->mboutdigits[cnt] == NULL) + { +- static struct charseq replace[2]; +- + if (!warned) + { + record_error (0, 0, _("\ +@@ -851,10 +849,12 @@ not all characters used in `outdigit' are available in the charmap")); + warned = 1; + } + +- replace[0].nbytes = 1; +- replace[0].bytes[0] = '?'; +- replace[0].bytes[1] = '\0'; +- ctype->mboutdigits[cnt] = &replace[0]; ++ static const struct charseq replace = ++ { ++ .nbytes = 1, ++ .bytes = "?", ++ }; ++ ctype->mboutdigits[cnt] = (struct charseq *) &replace; + } + + warned = 0; +-- +2.26.0 +