diff --git a/ChangeLog b/ChangeLog index 3c64d12..5934a6b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +1.9.7: Ludovic Rousseau +13 May 2022 +- disable strict compilation by default +- fix 3 warnings + + 1.9.6: Ludovic Rousseau 11 May 2022 - do not fail reader removal in some specific cases (USB/Thunderbolt port) diff --git a/ChangeLog.git b/ChangeLog.git index c994bf9..8dcca00 100644 --- a/ChangeLog.git +++ b/ChangeLog.git @@ -1,4 +1,134 @@ -commit c783224e5109258a17856f9ef90c044093bfc949 (HEAD -> master, zotac/master, origin/master, origin/HEAD, github/master) +commit 5c45145d34b5e7382e0223477ff22de67ef97c77 (HEAD -> master) +Author: Ludovic Rousseau +Date: Fri May 13 13:10:29 2022 +0200 + + Release 1.9.7 + + Signed-off-by: Ludovic Rousseau + + ChangeLog | 6 ++++++ + configure.ac | 2 +- + 2 files changed, 7 insertions(+), 1 deletion(-) + +commit 0482ec9082b9f00ee49d82c804c9cc7b53cfe99a +Author: Ludovic Rousseau +Date: Fri May 13 13:08:31 2022 +0200 + + c.sh: use --enable-strict + + c.sh | 1 + + 1 file changed, 1 insertion(+) + +commit b3f795550713121eb12d0c5e5ee5c9ac7be37b13 (debug/master) +Author: Ludovic Rousseau +Date: Fri May 13 12:53:52 2022 +0200 + + configure.ac: strict is disabled by default + + Use --enable-strict to use it. + Warnings will not stop the compilation, by default. + + configure.ac | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +commit c2ca47deab2cc802b09dd509aca118f73f63b169 (zotac/master, origin/master, origin/HEAD, github/master) +Author: Ludovic Rousseau +Date: Thu May 12 21:43:10 2022 +0200 + + Fix compiler warning: ignoring return value + + hotplug_libusb.c: In function ‘HPAddHotPluggable’: + hotplug_libusb.c:614:2: error: ignoring return value of ‘asprintf’, declared with attribute warn_unused_result [-Werror=unused-result] + 614 | asprintf(&deviceName, "usb:%04x/%04x:libusb-1.0:%s", + | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + 615 | desc.idVendor, desc.idProduct, bus_device); + | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + src/hotplug_libusb.c | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +commit 3c44ed0d4f7c2661c811b2bf0d1eea2b4ecaddbd +Author: Ludovic Rousseau +Date: Thu May 12 21:36:02 2022 +0200 + + Fix compiler warning: may be used uninitialized + + winscard_svc.c: In function 'ContextThread': + winscard_svc.c:540:28: error: 'dwActiveProtocol' may be used uninitialized in this function [-Werror=maybe-uninitialized] + 540 | rcStr.dwActiveProtocol = dwActiveProtocol; + | ^ + winscard_svc.c:530:11: note: 'dwActiveProtocol' was declared here + 530 | DWORD dwActiveProtocol; + | ^ + + src/winscard_svc.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 76c99cdd0ad5f6d57c4f8bde25dd2918bb8af3f7 +Author: Ludovic Rousseau +Date: Thu May 12 21:32:13 2022 +0200 + + Fix compilation warning: may be used uninitialized + + winscard_msg_srv.c:259:4: error: 'dwClientID' may be used uninitialized in this function [-Werror=maybe-uninitialized] + 259 | Log2(PCSC_LOG_ERROR, + | ^ + pcscdaemon.c:110:11: note: 'dwClientID' was declared here + 110 | uint32_t dwClientID; /* Connection ID used to reference the Client */ + | ^ + + src/pcscdaemon.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 71016c7e31b2dd535ee22848b7c647f179763552 +Author: Ludovic Rousseau +Date: Thu May 12 21:30:27 2022 +0200 + + github actions: add -Wp,-D_FORTIFY_SOURCE=2 + + .github/workflows/build.yml | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit afb4daaf4da028dbd4fc6c938bd4ba9269a32bb7 +Author: Ludovic Rousseau +Date: Thu May 12 21:27:30 2022 +0200 + + github actions: add -O2 to CFLAGS + + Optimize even more. GCC performs nearly all supported optimizations + that do not involve a space-speed tradeoff. As compared to -O, this + option increases both compilation time and the performance of the + generated code. + + .github/workflows/build.yml | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit c9b333bbee0e50b04241d68d509bfd691102b165 +Author: Ludovic Rousseau +Date: Thu May 12 21:23:24 2022 +0200 + + github actions: add -flto=auto to CFLAGS + + This option runs the standard link-time optimizer. When invoked with + source code, it generates GIMPLE (one of GCC's internal representations) + and writes it to special ELF sections in the object file. When the + object files are linked together, all the function bodies are read from + these ELF sections and instantiated as if they had been part of the same + translation unit. + + .github/workflows/build.yml | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 3dee6ca4d7bdc6beaac36108e00b3edc7bf2c046 +Author: Ludovic Rousseau +Date: Wed May 11 22:44:59 2022 +0200 + + github action: run make in verbose mode + + .github/workflows/build.yml | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit c783224e5109258a17856f9ef90c044093bfc949 (tag: 1.9.6) Author: Ludovic Rousseau Date: Wed May 11 17:06:28 2022 +0200 @@ -59,7 +189,7 @@ Date: Tue May 3 21:23:13 2022 +0200 src/hotplug_libudev.c | 20 -------------------- 1 file changed, 20 deletions(-) -commit a2f8a23685d2ff7bd607bafbea4ab3c0ecfc6c37 (debug/master) +commit a2f8a23685d2ff7bd607bafbea4ab3c0ecfc6c37 Author: Ludovic Rousseau Date: Sun Apr 3 15:37:26 2022 +0200 diff --git a/configure b/configure index de49c84..c55a8a8 100755 --- a/configure +++ b/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.71 for pcsc-lite 1.9.6. +# Generated by GNU Autoconf 2.71 for pcsc-lite 1.9.7. # # # Copyright (C) 1992-1996, 1998-2017, 2020-2021 Free Software Foundation, @@ -618,8 +618,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='pcsc-lite' PACKAGE_TARNAME='pcsc-lite' -PACKAGE_VERSION='1.9.6' -PACKAGE_STRING='pcsc-lite 1.9.6' +PACKAGE_VERSION='1.9.7' +PACKAGE_STRING='pcsc-lite 1.9.7' PACKAGE_BUGREPORT='' PACKAGE_URL='' @@ -1424,7 +1424,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures pcsc-lite 1.9.6 to adapt to many kinds of systems. +\`configure' configures pcsc-lite 1.9.7 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1495,7 +1495,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of pcsc-lite 1.9.6:";; + short | recursive ) echo "Configuration of pcsc-lite 1.9.7:";; esac cat <<\_ACEOF @@ -1535,7 +1535,7 @@ Optional Features: --disable-filter disable reader filtering using PCSCLITE_FILTER_IGNORE_READER_NAMES and PCSCLITE_FILTER_EXTEND_READER_NAMES - --disable-strict disable strict compile mode [enabled] + --enable-strict enable strict compile mode [enabled] Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] @@ -1649,7 +1649,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -pcsc-lite configure 1.9.6 +pcsc-lite configure 1.9.7 generated by GNU Autoconf 2.71 Copyright (C) 2021 Free Software Foundation, Inc. @@ -2065,7 +2065,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by pcsc-lite $as_me 1.9.6, which was +It was created by pcsc-lite $as_me 1.9.7, which was generated by GNU Autoconf 2.71. Invocation command line was $ $0$ac_configure_args_raw @@ -3336,7 +3336,7 @@ fi # Define the identity of the package. PACKAGE='pcsc-lite' - VERSION='1.9.6' + VERSION='1.9.7' printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h @@ -16599,18 +16599,18 @@ printf "%s\n" "#define FILTER_NAMES 1" >>confdefs.h PCSCLITE_FEATURES="${PCSCLITE_FEATURES} filter" fi -# --disable-strict +# --enable-strict # Check whether --enable-strict was given. if test ${enable_strict+y} then : enableval=$enable_strict; else $as_nop - enable_strict="yes" + enable_strict="no" fi if test "${enable_strict}" = "yes"; then - CFLAGS="-Wall -Wextra -Wno-unused-parameter -Werror ${CFLAGS}" + CFLAGS="-Wall -Wextra -Werror ${CFLAGS}" fi # Setup dist stuff @@ -17236,7 +17236,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by pcsc-lite $as_me 1.9.6, which was +This file was extended by pcsc-lite $as_me 1.9.7, which was generated by GNU Autoconf 2.71. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -17304,7 +17304,7 @@ ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config='$ac_cs_config_escaped' ac_cs_version="\\ -pcsc-lite config.status 1.9.6 +pcsc-lite config.status 1.9.7 configured by $0, generated by GNU Autoconf 2.71, with options \\"\$ac_cs_config\\" diff --git a/configure.ac b/configure.ac index 1046c80..e4d5571 100644 --- a/configure.ac +++ b/configure.ac @@ -3,7 +3,7 @@ AC_PREREQ([2.69]) -AC_INIT([pcsc-lite],[1.9.6]) +AC_INIT([pcsc-lite],[1.9.7]) AC_CONFIG_SRCDIR(src/pcscdaemon.c) AM_INIT_AUTOMAKE(1.8 dist-bzip2 no-dist-gzip) AC_CONFIG_HEADERS([config.h]) @@ -402,15 +402,15 @@ if test x$use_filter = xyes; then PCSCLITE_FEATURES="${PCSCLITE_FEATURES} filter" fi -# --disable-strict +# --enable-strict AC_ARG_ENABLE( [strict], - [AS_HELP_STRING([--disable-strict],[disable strict compile mode @<:@enabled@:>@])], + [AS_HELP_STRING([--enable-strict],[enable strict compile mode @<:@enabled@:>@])], , - [enable_strict="yes"] + [enable_strict="no"] ) if test "${enable_strict}" = "yes"; then - CFLAGS="-Wall -Wextra -Wno-unused-parameter -Werror ${CFLAGS}" + CFLAGS="-Wall -Wextra -Werror ${CFLAGS}" fi # Setup dist stuff diff --git a/src/hotplug_libusb.c b/src/hotplug_libusb.c index 3164101..b9be449 100644 --- a/src/hotplug_libusb.c +++ b/src/hotplug_libusb.c @@ -611,8 +611,13 @@ static LONG HPAddHotPluggable(struct libusb_device *dev, Log2(PCSC_LOG_INFO, "Adding USB device: %s", bus_device); - asprintf(&deviceName, "usb:%04x/%04x:libusb-1.0:%s", + i = asprintf(&deviceName, "usb:%04x/%04x:libusb-1.0:%s", desc.idVendor, desc.idProduct, bus_device); + if (-1 == i) + { + Log1(PCSC_LOG_ERROR, "asprintf() failed"); + return 0; + } pthread_mutex_lock(&usbNotifierMutex); diff --git a/src/pcscdaemon.c b/src/pcscdaemon.c index e07ade4..35649c3 100644 --- a/src/pcscdaemon.c +++ b/src/pcscdaemon.c @@ -107,7 +107,7 @@ static void SVCServiceRunLoop(void) { int rsp; LONG rv; - uint32_t dwClientID; /* Connection ID used to reference the Client */ + uint32_t dwClientID = 0; /* Connection ID used to reference the Client */ while (TRUE) { diff --git a/src/winscard_svc.c b/src/winscard_svc.c index 7729353..3eda96f 100644 --- a/src/winscard_svc.c +++ b/src/winscard_svc.c @@ -527,7 +527,7 @@ static void * ContextThread(LPVOID newContext) case SCARD_RECONNECT: { struct reconnect_struct rcStr; - DWORD dwActiveProtocol; + DWORD dwActiveProtocol = SCARD_PROTOCOL_UNDEFINED; READ_BODY(rcStr);