Hi,
On Mon, 3 Jun 2024 at 11:39, jayesh bhoi <
jayesh...@gmail.com> wrote:
> ffi.error: struct tr_tcp_config: wrong total size (cdef says 24, but C compiler says 48). fix it or use "...;" as the last field in the cdef for struct tr_tcp_config to make it flexible
>
> so what could be the reason for this issue?
The ffi.cdef() contains a declaration of `struct tr_tcp_config`, but
that is not a correct one. You must find `struct tr_tcp_config`, both
in the cdef() and in the actual C header you are using, and compare
the two. You can either copy and paste the exact declaration from the
C header to the cdef(), or in some cases you can write in the cdef()
something more general and potentially portable (if you want help for
that case I'll need to know the original declaration from the header;
or read
https://cffi.readthedocs.io/en/stable/cdef.html#letting-the-c-compiler-fill-the-gaps).
A bientôt,
Armin Rigo