Page MenuHome GnuPG

Fix signature of assuan read and write callbacks
Needs ReviewPublic

Authored by CarlSchwan on Jun 4 2024, 5:32 PM.

Details

Reviewers
werner
Summary
  • src/assuan-support.c: Change my_read and my_write return type from gpgme_ssize_t to ssize_t --

assuan_system_hooks expects ssize_t instead of gpgme_ssize_t for the
return types of the read and write callbacks.

Test Plan

Compile

Diff Detail

Repository
rM GPGME
Branch
work/carl/assuan-ssize_t
Lint
No Linters Available
Unit
No Unit Test Coverage

Event Timeline

CarlSchwan created this revision.

I found the following in this file. This looks as if everything should stay as it is.

/* Note for Windows: Ignore the incompatible pointer type warning for
   my_read and my_write.  Mingw has been changed to use int for
   ssize_t on 32 bit systems while we use long.  For 64 bit we use
   int64_t while mingw uses __int64_t.  It does not matter at all
   because under Windows long and int are both 32 bit even on 64
   bit.  */

gpgme_ssize_t is even documented in gpgme.texi.

I found the following in this file. This looks as if everything should stay as it is.

/* Note for Windows: Ignore the incompatible pointer type warning for
   my_read and my_write.  Mingw has been changed to use int for
   ssize_t on 32 bit systems while we use long.  For 64 bit we use
   int64_t while mingw uses __int64_t.  It does not matter at all
   because under Windows long and int are both 32 bit even on 64
   bit.  */

gpgme_ssize_t is even documented in gpgme.texi.

But assuan_system_hooks is documented as returning a ssize_t and not a gpgme_ssize_t int https://www.gnupg.org/documentation/manuals/assuan/Contexts.html

so if we want to use long everywhere, we should change the return type in assuan_system_hooks