From: rliebscher <no...@gi...> - 2020-06-22 08:47:26
|
Branch: refs/heads/master Home: https://github.com/OpenSC/OpenSC Commit: 4d96fbfed4818cebaa954ef48f3397f123de5566 https://github.com/OpenSC/OpenSC/commit/4d96fbfed4818cebaa954ef48f3397f123de5566 Author: René Liebscher <r.l...@gm...> Date: 2020-06-22 (Mon, 22 Jun 2020) Changed paths: M src/common/compat_getopt_main.c M src/libopensc/card-sc-hsm.c M src/libopensc/sc.c M src/pkcs15init/profile.c M src/tools/goid-tool.c M src/tools/opensc-explorer.c M src/tools/pkcs15-init.c Log Message: ----------- Remove compiler warnings/errors Recent compilers have activated some additional checks which let the build fail. (at least with cygwin) (Normally it would be warnings but opensc compiles with -Werror) GCC 9.3: In file included from profile.c:27: profile.c: In function '__expr_get': profile.c:2273:18: error: array subscript has type 'char' [-Werror=char-subscripts] 2273 | while (isspace(*s)) | ^~ clang 8.0.1: compat_getopt_main.c:102:22: error: array subscript is of type 'char' [-Werror,-Wchar-subscripts] rc = toupper(rc); ^~~~~~~~~~~ /usr/include/ctype.h:161:25: note: expanded from macro 'toupper' (void) __CTYPE_PTR[__x]; (toupper) (__x);}) ^~~~ Actually the code is correct as isspace and others are used here with data type char, and are to be used with data type int. So either the compiler should have deactivated this error, or the ctype.h macros have to be written so the compiler no longer complains. As there is also a simple workaround by casting char to unsigned char, there is no need to wait for one of the former options to be happen sometime. |