]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
gperf: Make the code C++17 compliant
authorKhem Raj <raj.khem@gmail.com>
Sat, 14 Jan 2023 15:49:21 +0000 (07:49 -0800)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 16 Jan 2023 10:40:08 +0000 (10:40 +0000)
Fixes
| ../../gperf-3.1/lib/getline.cc:58:7: error: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
|       register int c = getc (stream);
|       ^~~~~~~~~

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/recipes-extended/gperf/gperf/0001-Make-the-code-C-17-compliant.patch [new file with mode: 0644]
meta/recipes-extended/gperf/gperf_3.1.bb

diff --git a/meta/recipes-extended/gperf/gperf/0001-Make-the-code-C-17-compliant.patch b/meta/recipes-extended/gperf/gperf/0001-Make-the-code-C-17-compliant.patch
new file mode 100644 (file)
index 0000000..96e70cd
--- /dev/null
@@ -0,0 +1,29 @@
+From 6194f0027045433598a61965758b4531a3d06d1f Mon Sep 17 00:00:00 2001
+From: Bruno Haible <bruno@clisp.org>
+Date: Sun, 30 Aug 2020 12:36:15 +0200
+Subject: [PATCH] Make the code C++17 compliant.
+
+* lib/getline.cc (getstr): Don't use the 'register' keyword.
+
+Upstream-Status: Backport [https://git.savannah.gnu.org/gitweb/?p=gperf.git;a=commit;h=a63b830554920476881837eeacd4a6b507632b19]
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ lib/getline.cc | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/lib/getline.cc b/lib/getline.cc
+index c57c633..0984a7c 100644
+--- a/lib/getline.cc
++++ b/lib/getline.cc
+@@ -55,7 +55,7 @@ getstr (char **lineptr, size_t *n, FILE *stream, char terminator, size_t offset)
+   for (;;)
+     {
+-      register int c = getc (stream);
++      int c = getc (stream);
+       /* We always want at least one char left in the buffer, since we
+          always (unless we get an error while reading the first char)
+-- 
+2.39.0
+
index 4c32a5dc832ceed9d77054f6ae8c633fddc3a6e8..c57ade9fe3817e4355ae92fec9cc24d619f320c9 100644 (file)
@@ -5,7 +5,8 @@ LICENSE  = "GPL-3.0-or-later"
 LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504 \
                     file://src/main.cc;beginline=8;endline=19;md5=dec8f611845d047387ed56b5b85fa99b"
 
-SRC_URI  = "${GNU_MIRROR}/${BPN}/${BP}.tar.gz"
+SRC_URI  = "${GNU_MIRROR}/${BPN}/${BP}.tar.gz \
+            file://0001-Make-the-code-C-17-compliant.patch"
 SRC_URI[md5sum] = "9e251c0a618ad0824b51117d5d9db87e"
 SRC_URI[sha256sum] = "588546b945bba4b70b6a3a616e80b4ab466e3f33024a352fc2198112cdbb3ae2"