From: Wang Mingyu <wan...@fujitsu.com>

Signed-off-by: Wang Mingyu <wan...@fujitsu.com>
---
 ...e-pointer-type-error-with-gcc-option.patch | 65 +++++++++++++++++++
 .../recipes-support/openct/openct_0.6.20.bb   |  1 +
 2 files changed, 66 insertions(+)
 create mode 100644 
meta-oe/recipes-support/openct/openct/0001-Fix-incompatible-pointer-type-error-with-gcc-option.patch

diff --git 
a/meta-oe/recipes-support/openct/openct/0001-Fix-incompatible-pointer-type-error-with-gcc-option.patch
 
b/meta-oe/recipes-support/openct/openct/0001-Fix-incompatible-pointer-type-error-with-gcc-option.patch
new file mode 100644
index 000000000..73c9d0666
--- /dev/null
+++ 
b/meta-oe/recipes-support/openct/openct/0001-Fix-incompatible-pointer-type-error-with-gcc-option.patch
@@ -0,0 +1,65 @@
+From c4351058da555e1e6a2b4b15d913baee80f55865 Mon Sep 17 00:00:00 2001
+From: Wang Mingyu <wan...@fujitsu.com>
+Date: Thu, 27 Jun 2024 06:27:18 +0000
+Subject: Fix incompatible pointer type error with gcc option 
+ -Wincompatible-pointer-types
+
+| ../../../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 
[-Wincompatible-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 
*);
+
+Upstream-Status: Submitted
+
+Signed-off-by: Wang Mingyu <wan...@fujitsu.com>
+---
+ src/ifd/ifdhandler.c | 2 +-
+ src/ifd/process.c    | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/ifd/ifdhandler.c b/src/ifd/ifdhandler.c
+index 12686c9..ebd1b53 100644
+--- a/src/ifd/ifdhandler.c
++++ b/src/ifd/ifdhandler.c
+@@ -236,7 +236,7 @@ static void ifdhandler_run(ifd_reader_t * reader)
+               sock->fd = -1;
+       }
+       else {
+-              sock->fd = ifd_get_eventfd(reader, &sock->events);
++              sock->fd = ifd_get_eventfd(reader, (short int *)&sock->events);
+       }
+       if (sock->fd == -1) {
+               ifd_debug(1, "events inactive for reader %s", reader->name);
+diff --git a/src/ifd/process.c b/src/ifd/process.c
+index 4563bdf..7088a76 100644
+--- a/src/ifd/process.c
++++ b/src/ifd/process.c
+@@ -458,7 +458,7 @@ static int do_memory_write(ifd_reader_t * reader, int unit,
+               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);
+-- 
+2.34.1
+
diff --git a/meta-oe/recipes-support/openct/openct_0.6.20.bb 
b/meta-oe/recipes-support/openct/openct_0.6.20.bb
index e4b99089f..e013fb26e 100644
--- a/meta-oe/recipes-support/openct/openct_0.6.20.bb
+++ b/meta-oe/recipes-support/openct/openct_0.6.20.bb
@@ -18,6 +18,7 @@ SRC_URI = " \
     file://openct.init \
     file://openct.sysconfig \
     file://openct.service \
+    file://0001-Fix-incompatible-pointer-type-error-with-gcc-option.patch \
 "
 
 SRC_URI[md5sum] = "a1da3358ab798f1cb9232f1dbababc21"
-- 
2.34.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#111122): 
https://lists.openembedded.org/g/openembedded-devel/message/111122
Mute This Topic: https://lists.openembedded.org/mt/106905592/21656
Group Owner: openembedded-devel+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to