warnings in libgpg-error

Vincent Torri vincent.torri at gmail.com
Sat Dec 25 21:37:01 CET 2021


Hello

i'm compiling libgpg-error on Windows with msys2 + mingw-w64. I have
those warnings :


spawn-w32.c: In function '_gpgrt_spawn_process':
spawn-w32.c:81:27: warning: cast from pointer to integer of different
size [-Wpointer-to-int-cast]
   81 | #define handle_to_pid(a) ((int)(a))
      |                           ^
spawn-w32.c:634:10: note: in expansion of macro 'handle_to_pid'
  634 |   *pid = handle_to_pid (pi.hProcess);
      |          ^~~~~~~~~~~~~
spawn-w32.c: In function '_gpgrt_spawn_process_fd':
spawn-w32.c:81:27: warning: cast from pointer to integer of different
size [-Wpointer-to-int-cast]
   81 | #define handle_to_pid(a) ((int)(a))
      |                           ^
spawn-w32.c:717:10: note: in expansion of macro 'handle_to_pid'
  717 |   *pid = handle_to_pid (pi.hProcess);
      |          ^~~~~~~~~~~~~


a possible fix would be :

#define handle_to_pid(a) ((int)(uintptr_t)(a))

best regards

Vincent Torri



More information about the Gcrypt-devel mailing list