Skip to content

Conversation

@wangmingyu84
Copy link

When build with gcc14 the following error occurred:
| ../../../openct-0.6.20/src/ifd/ifdhandler.c: In function 'ifdhandler_run':
| ../../../openct-0.6.20/src/ifd/ifdhandler.c:239:52: error: passing argument 2 of 'ifd_get_eventfd' from incompatible pointer type [-Wincompatible-pointer-types]
| 239 | sock->fd = ifd_get_eventfd(reader, &sock->events);
| | ^~~~~~~~~~~~~
| | |
| | int *
| In file included from ../../../openct-0.6.20/src/ifd/internal.h:17,
| from ../../../openct-0.6.20/src/ifd/ifdhandler.c:7:
| ../../../openct-0.6.20/src/include/openct/ifd.h:182:65: note: expected 'short int *' but argument is of type 'int *'
| 182 | extern int ifd_get_eventfd(ifd_reader_t *, short *);
| | ^~~~~~~

| ../../../openct-0.6.20/src/ifd/process.c: In function 'do_memory_write':
| ../../../openct-0.6.20/src/ifd/process.c:461:61: error: passing argument 4 of 'ct_tlv_get_opaque' from incompatible pointer type -incompatible-pointer-types]
| 461 | || !ct_tlv_get_opaque(args, CT_TAG_DATA, &data, &data_len))
| | ^~~~~~~~~
| | |
| | unsigned int *
| In file included from ../../../openct-0.6.20/src/ifd/process.c:20:
| ../../../openct-0.6.20/src/include/openct/tlv.h:40:62: note: expected 'size_t *' {aka 'long unsigned int *'} but argument is of type 'unsigned int *'
| 40 | ifd_tag_t, unsigned char **, size_t *);

Signed-off-by: Wang Mingyu <wangmy@cn.fujitsu.com>
@0-wiz-0
Copy link

0-wiz-0 commented Feb 3, 2026

The patch is incomplete, this is also needed for src/ifd/process.c:

@@ -458,7 +458,7 @@ static int do_memory_write(ifd_reader_t * reader, int
                return IFD_ERROR_INVALID_SLOT;

        if (ct_tlv_get_int(args, CT_TAG_ADDRESS, &address) == 0
-           || !ct_tlv_get_opaque(args, CT_TAG_DATA, &data, &data_len))
+           || !ct_tlv_get_opaque(args, CT_TAG_DATA, &data, (size_t *)&data_len))
                return IFD_ERROR_MISSING_ARG;

        rc = ifd_card_write_memory(reader, unit, address, data, data_len);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants