gperf: Make the code C++17 compliant

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);
|       ^~~~~~~~~

(From OE-Core rev: dd137feabdad2e7a2b3d107c703aad577a2e79c7)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Khem Raj
2023-01-14 07:49:21 -08:00
committed by Richard Purdie
parent b622f7f8f0
commit 288cc5b879
2 changed files with 31 additions and 1 deletions

View File

@@ -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

View 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"