You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Merging last commits introduced pointer incompatibility call sc_format_apdu_ex() with wrong arguments in src/libopensc/card-mcrd.c, which fails to compile with the default -Werror switch.
Specifically, sc_format_apdu_ex() does not have an input parameter of type sc_card_t, it's first parameter is of type struct sc_apdu *.
Proposed Resolution
Call sc_format_apdu_ex() with the correct arguments in src/libopensc/card-mcrd.c.
Looks like it needs ..., cla, ins, p1, p2, ... - and one of these four is missing from the list of arguments.
Steps to reproduce
Configure, compile, observe the output
Logs
libtool: compile: clang -DHAVE_CONFIG_H -I. -I../.. -DOPENSC_CONF_PATH=\"/Library/OpenSC/etc/opensc.conf\" -DDEFAULT_SM_MODULE_PATH=\"/Library/OpenSC/lib\" -DDEFAULT_SM_MODULE=\"libsmm-local.so\" -I../../src -I/opt/local/include -I/opt/local/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/PCSC.framework/Versions/Current/Headers -march=native -Os -Ofast -std=gnu17 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk -arch x86_64 -Wall -Wextra -Wno-unused-parameter -Werror -c card-mcrd.c -fno-common -DPIC -o .libs/libopensc_la-card-mcrd.o
card-mcrd.c:199:20: error: incompatible pointer types passing 'sc_card_t *' (aka 'struct sc_card *') to parameter of
type 'struct sc_apdu *' [-Werror,-Wincompatible-pointer-types]
sc_format_apdu_ex(card, &apdu, 0x22, 0x41, 0xA4, sbuf, 2, NULL, 0);
^~~~
../../src/libopensc/opensc.h:824:40: note: passing argument to parameter 'apdu' here
void sc_format_apdu_ex(struct sc_apdu *apdu,
^
card-mcrd.c:199:26: error: incompatible pointer to integer conversion passing 'sc_apdu_t *' (aka 'struct sc_apdu *') to
parameter of type 'u8' (aka 'unsigned char') [-Werror,-Wint-conversion]
sc_format_apdu_ex(card, &apdu, 0x22, 0x41, 0xA4, sbuf, 2, NULL, 0);
^~~~~
../../src/libopensc/opensc.h:825:6: note: passing argument to parameter 'cla' here
u8 cla, u8 ins, u8 p1, u8 p2,
^
card-mcrd.c:212:20: error: incompatible pointer types passing 'sc_card_t *' (aka 'struct sc_card *') to parameter of
type 'struct sc_apdu *' [-Werror,-Wincompatible-pointer-types]
sc_format_apdu_ex(card, &apdu, 0x22, 0x41, 0xB6, sbuf, 2, NULL, 0);
^~~~
../../src/libopensc/opensc.h:824:40: note: passing argument to parameter 'apdu' here
void sc_format_apdu_ex(struct sc_apdu *apdu,
^
card-mcrd.c:212:26: error: incompatible pointer to integer conversion passing 'sc_apdu_t *' (aka 'struct sc_apdu *') to
parameter of type 'u8' (aka 'unsigned char') [-Werror,-Wint-conversion]
sc_format_apdu_ex(card, &apdu, 0x22, 0x41, 0xB6, sbuf, 2, NULL, 0);
^~~~~
../../src/libopensc/opensc.h:825:6: note: passing argument to parameter 'cla' here
u8 cla, u8 ins, u8 p1, u8 p2,
^
card-mcrd.c:1026:21: error: incompatible pointer types passing 'sc_card_t *' (aka 'struct sc_card *') to parameter of
type 'struct sc_apdu *' [-Werror,-Wincompatible-pointer-types]
sc_format_apdu_ex(card, &apdu, 0x22, 0x41, 0xB8, sbuf, 5, NULL, 0);
^~~~
../../src/libopensc/opensc.h:824:40: note: passing argument to parameter 'apdu' here
void sc_format_apdu_ex(struct sc_apdu *apdu,
^
card-mcrd.c:1026:27: error: incompatible pointer to integer conversion passing 'sc_apdu_t *' (aka 'struct sc_apdu *')
to parameter of type 'u8' (aka 'unsigned char') [-Werror,-Wint-conversion]
sc_format_apdu_ex(card, &apdu, 0x22, 0x41, 0xB8, sbuf, 5, NULL, 0);
^~~~~
../../src/libopensc/opensc.h:825:6: note: passing argument to parameter 'cla' here
u8 cla, u8 ins, u8 p1, u8 p2,
^
card-mcrd.c:1029:21: error: incompatible pointer types passing 'sc_card_t *' (aka 'struct sc_card *') to parameter of
type 'struct sc_apdu *' [-Werror,-Wincompatible-pointer-types]
sc_format_apdu_ex(card, &apdu, 0x22, 0x41, 0xB6, sbuf, 5, NULL, 0);
^~~~
../../src/libopensc/opensc.h:824:40: note: passing argument to parameter 'apdu' here
void sc_format_apdu_ex(struct sc_apdu *apdu,
^
card-mcrd.c:1029:27: error: incompatible pointer to integer conversion passing 'sc_apdu_t *' (aka 'struct sc_apdu *')
to parameter of type 'u8' (aka 'unsigned char') [-Werror,-Wint-conversion]
sc_format_apdu_ex(card, &apdu, 0x22, 0x41, 0xB6, sbuf, 5, NULL, 0);
^~~~~
../../src/libopensc/opensc.h:825:6: note: passing argument to parameter 'cla' here
u8 cla, u8 ins, u8 p1, u8 p2,
^
8 errors generated.
Update
Merely removing the first argument card from the calls to sc_format_apdu_ex() does not help, as then it's one input argument short. Work is needed.
The text was updated successfully, but these errors were encountered:
Problem Description
Merging last commits
introduced pointer incompatibilitycallsc_format_apdu_ex()
with wrong arguments insrc/libopensc/card-mcrd.c
, which fails to compile with the default-Werror
switch.Specifically,
sc_format_apdu_ex()
does not have an input parameter of typesc_card_t
, it's first parameter is of typestruct sc_apdu *
.Proposed Resolution
Call
sc_format_apdu_ex()
with the correct arguments insrc/libopensc/card-mcrd.c
.Looks like it needs
..., cla, ins, p1, p2, ...
- and one of these four is missing from the list of arguments.Steps to reproduce
Configure, compile, observe the output
Logs
Update
Merely removing the first argument
card
from the calls tosc_format_apdu_ex()
does not help, as then it's one input argument short. Work is needed.The text was updated successfully, but these errors were encountered: