From 43fe836542f8c3fb8953d1961c3b2b22edd567d0 Mon Sep 17 00:00:00 2001 From: jammyjellyfish Date: Wed, 19 Apr 2023 17:34:37 +0800 Subject: [PATCH] Fix prototype warning --- 0001-Fix-prototype-warnings.patch | 38 +++++++++++++++++++++++++++++++ opensc.spec | 5 +++- 2 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 0001-Fix-prototype-warnings.patch diff --git a/0001-Fix-prototype-warnings.patch b/0001-Fix-prototype-warnings.patch new file mode 100644 index 0000000..1619589 --- /dev/null +++ b/0001-Fix-prototype-warnings.patch @@ -0,0 +1,38 @@ +From 7c9abd06f57275d109d6b22a577c7c80dd007543 Mon Sep 17 00:00:00 2001 +From: jammyjellyfish +Date: Wed, 19 Apr 2023 15:55:06 +0800 +Subject: [PATCH] Fix prototype warnings + +The flag -Wdeprecated-non-prototype is enabled by +default in Clang 15. This patch try to fix compile +error when building with Clang 15(and gcc with +-Wstrict-prototypes flag.) +--- + src/libopensc/card-openpgp.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/libopensc/card-openpgp.c b/src/libopensc/card-openpgp.c +index fad32f0..ea1d874 100644 +--- a/src/libopensc/card-openpgp.c ++++ b/src/libopensc/card-openpgp.c +@@ -129,7 +129,7 @@ static pgp_ec_curves_t ec_curves_gnuk[] = { + + static int pgp_get_card_features(sc_card_t *card); + static int pgp_finish(sc_card_t *card); +-static void pgp_iterate_blobs(pgp_blob_t *, void (*func)()); ++static void pgp_iterate_blobs(pgp_blob_t *blob, void (*func)(pgp_blob_t *)); + + static int pgp_get_blob(sc_card_t *card, pgp_blob_t *blob, + unsigned int id, pgp_blob_t **ret); +@@ -1150,7 +1150,7 @@ pgp_free_blob(pgp_blob_t *blob) + * Internal: iterate through the blob tree, calling a function for each blob. + */ + static void +-pgp_iterate_blobs(pgp_blob_t *blob, void (*func)()) ++pgp_iterate_blobs(pgp_blob_t *blob, void (*func)(pgp_blob_t *)) + { + if (blob) { + pgp_blob_t *child = blob->files; +-- +2.40.0 + diff --git a/opensc.spec b/opensc.spec index b30bda0..d57c959 100644 --- a/opensc.spec +++ b/opensc.spec @@ -3,7 +3,7 @@ Name: opensc Version: 0.23.0 -Release: 1 +Release: 2 License: LGPL-2.1-or-later Summary: Smart card library and applications URL: https://github.com/OpenSC/OpenSC/wiki @@ -139,6 +139,9 @@ make check %{_datadir}/opensc/ %changelog +* Thu May 4 2023 jammyjellyfish - 0.23.0-2 +- fix prototype warning + * Wed Feb 1 2023 wangjunqi - 0.23.0-1 - update version to 0.23.0 -- Gitee