From patchwork Sat Mar 28 22:07:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Seiderer X-Patchwork-Id: 1263328 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=giJrHd6X; 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 48qXsY4DSzz9sR4 for ; Sun, 29 Mar 2020 09:08:01 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 420B9887C8; Sat, 28 Mar 2020 22:07:59 +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 8dTygvcLYjDM; Sat, 28 Mar 2020 22:07:58 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id D3F878243D; Sat, 28 Mar 2020 22:07:57 +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 28FA91BF3E3 for ; Sat, 28 Mar 2020 22:07:56 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 2543E8766A for ; Sat, 28 Mar 2020 22:07:56 +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 CD8bKhce0YTR for ; Sat, 28 Mar 2020 22:07:54 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mout.gmx.net (mout.gmx.net [212.227.15.15]) by whitealder.osuosl.org (Postfix) with ESMTPS id 09BE6878BE for ; Sat, 28 Mar 2020 22:07:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1585433271; bh=gpGJD9exa5z46bFYwJaX5x3tsf6DVsLlO3/vLmtT61g=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date; b=giJrHd6X66W8M4XMFoMEUjvuzLE34Zk0oCs9d7Qs5LV9neSqI6kYOfjlVgvD1FwbU O8Gz7fThUwJrCrWGRsRs15GaVPc+xWrv3uLPZ7cMNufPhyMIqis7pvOqIDsWRdZsG7 RrrZ4v/wbpAAnSDC261kZS/8q6kl2IVVt/73KV3M= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from localhost.fritz.box ([62.216.209.21]) by mail.gmx.com (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MZCb5-1inE633aOf-00VB8Z; Sat, 28 Mar 2020 23:07:50 +0100 From: Peter Seiderer To: buildroot@busybox.net Date: Sat, 28 Mar 2020 23:07:49 +0100 Message-Id: <20200328220750.17732-1-ps.report@gmx.net> X-Mailer: git-send-email 2.26.0 MIME-Version: 1.0 X-Provags-ID: V03:K1:A1oa33VFJaE03UcoPZV4hy0/LtNNhLIL21HgWYcdfvjx2xd61hD 0LpcS1FirrsQQ/Wcd0P4FQ+zFQTxsY3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F/qgKouw 4WICJY+iVIwXIH7shKtM1xuF161FDHHi+zMk0EVwVURZsEyirytSiZ6V3Pg0KLVHWLfTHySaR fdS0G7gkirTJefb9h/kkLOVFM68mOyB9+C3TGaNaN+Vqg/igt+6GLSqCdr6cIeexRr4Utekp/ nb0pLsJJ4h25i+7gs7r2fbbm1kzQSItvfz8BuRhAdL7o4OUULlYgBSN7jOGKX5gefF9xxFuyF CFeeFOJdLoYjy9CrsIoeXnfxhRoQ8j+ooN/FUfCY9YdYU7dVY3HvCYiV4yE1CdzVBK0nZ2OI2 Tbc/0VMWWegxLfsY9W3SXX11y2us+z8vQBPX2QtBGQCDV659Yu+agVXvcW77gWGOHdDojmB5w OgO2RVMMMeQX3C6Kz Subject: [Buildroot] [PATCH v1] 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: Thomas Petazzoni 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 +