From 035ef77776baa2dac9775e0b57d5c62d4c228c41 Mon Sep 17 00:00:00 2001 From: Jakub Jelen Date: Wed, 9 Jan 2019 10:59:05 +0100 Subject: [PATCH] GCC9 Compatibility --- opensc-0.19.0-gcc9.patch | 31 +++++++++++++++++++++++++++++++ opensc.spec | 3 +++ 2 files changed, 34 insertions(+) create mode 100644 opensc-0.19.0-gcc9.patch diff --git a/opensc-0.19.0-gcc9.patch b/opensc-0.19.0-gcc9.patch new file mode 100644 index 0000000..75f4b02 --- /dev/null +++ b/opensc-0.19.0-gcc9.patch @@ -0,0 +1,31 @@ +commit 35cb70b5d664c4be417dee2cbe6b652185e6da2d +Author: Khem Raj +Date: Mon Dec 17 18:44:23 2018 -0800 + + Remove redundant logging + + Same information is printed a few line below in same function, the only + difference is that there it takes care of case when label is NULL pointer + unlike this line + + secondly, every function call to cosm_write_tokeninfo() in this file + passes label=NULL, and then it tries to print a null pointer + + Fixes errors like + src/libopensc/log.h:48:47: error: '%s' directive argument is null + [-Werror=format-overflow=] + + Signed-off-by: Khem Raj + +diff --git a/src/pkcs15init/pkcs15-oberthur.c b/src/pkcs15init/pkcs15-oberthur.c +index 322a74a4..98a61d5a 100644 +--- a/src/pkcs15init/pkcs15-oberthur.c ++++ b/src/pkcs15init/pkcs15-oberthur.c +@@ -70,7 +70,6 @@ cosm_write_tokeninfo (struct sc_pkcs15_card *p15card, struct sc_profile *profile + ctx = p15card->card->ctx; + + SC_FUNC_CALLED(ctx, SC_LOG_DEBUG_VERBOSE); +- sc_debug(ctx, SC_LOG_DEBUG_NORMAL, "cosm_write_tokeninfo() label '%s'; flags 0x%X", label, flags); + if (sc_profile_get_file(profile, COSM_TITLE"-token-info", &file)) { + rv = SC_ERROR_INCONSISTENT_PROFILE; + SC_TEST_GOTO_ERR(ctx, SC_LOG_DEBUG_NORMAL, rv, "Cannot find "COSM_TITLE"-token-info"); diff --git a/opensc.spec b/opensc.spec index fb81285..3518adc 100644 --- a/opensc.spec +++ b/opensc.spec @@ -15,6 +15,8 @@ Source1: opensc.module # https://github.com/OpenSC/OpenSC/pull/1521 Patch2: opensc-0.19.0-rsa-pss.patch Patch3: opensc-0.19.0-pinpad.patch +# https://github.com/OpenSC/OpenSC/pull/1557 +Patch4: opensc-0.19.0-gcc9.patch BuildRequires: pcsc-lite-devel BuildRequires: readline-devel @@ -44,6 +46,7 @@ every software/card that does so, too. %setup -q %patch2 -p1 -b .pss %patch3 -p1 -b .pinpad +%patch4 -p1 -b .gcc9 cp -p src/pkcs15init/README ./README.pkcs15init cp -p src/scconf/README.scconf .