Mailing List Archive

[PATCH gnupg] Fix pointer to integer cast warnings in Windows platform
Re: [PATCH gnupg] Fix pointer to integer cast warnings in Windows platform [ In reply to ]
Is it possible to review the patch please? Am I missing something
which can prevent the review process?

_______________________________________________
Gnupg-devel mailing list
Gnupg-devel@gnupg.org
https://lists.gnupg.org/mailman/listinfo/gnupg-devel
Re: [PATCH gnupg] Fix pointer to integer cast warnings in Windows platform [ In reply to ]
On Sat, 1 Oct 2022 23:21, Biswapriyo Nath said:
> Is it possible to review the patch please? Am I missing something
> which can prevent the review process?

Casting warnings away is not a good idea. Further the uintptr_t is not
available on all platforms.

We keep the warnings as a reminder that we need to replace all kind of
sockets/fds/streams by estream system objects.


Shalom-Salam,

Werner

--
The pioneers of a warless world are the youth that
refuse military service. - A. Einstein
Re: [PATCH gnupg] Fix pointer to integer cast warnings in Windows platform [ In reply to ]
> We keep the warnings as a reminder that we need to replace all kind of
> sockets/fds/streams by estream system objects.

With clang version 15, the pointer to integer conversion warnings are
treated as errors by default[1]. That causes build failure with mingw
clang toolchain. So, do you suggest to use `-Wno-int-conversion`
compiler flag with all projects i.e. gnupg, gnutls etc. ?

[1]: https://releases.llvm.org/15.0.0/tools/clang/docs/ReleaseNotes.html

_______________________________________________
Gnupg-devel mailing list
Gnupg-devel@gnupg.org
https://lists.gnupg.org/mailman/listinfo/gnupg-devel
Re: [PATCH gnupg] Fix pointer to integer cast warnings in Windows platform [ In reply to ]
Hello,

Biswapriyo Nath wrote:
> Is it possible to review the patch please? Am I missing something
> which can prevent the review process?

I think that you assume that GnuPG is supported on Windows for 64-bit
architecture. I don't think it's true. My understanding is that we
need to fix problems, for Windows for 64-bit architecture.

It seems for me that your changes basically to silence warnings, hiding
the problems instead of fixing.

For now, I can only comment two changes:

diff --git a/agent/call-daemon.c b/agent/call-daemon.c
index 0c36052..cb03f3a 100644
--- a/agent/call-daemon.c
+++ b/agent/call-daemon.c
@@ -472,7 +472,7 @@ daemon_start (enum daemon_type type, ctrl_t ctrl)

#ifdef HAVE_W32_SYSTEM
snprintf (buf, sizeof buf, "OPTION event-signal=%lx",
- (unsigned long)get_agent_daemon_notify_event ());
+ (unsigned long)(uintptr_t)get_agent_daemon_notify_event ());
#else
snprintf (buf, sizeof buf, "OPTION event-signal=%d", SIGUSR2);
#endif


IIUC, you tried to silence the warning of -Wpointer-to-int-cast.
If I fixed, I would fix the printing format and remove the cast.


diff --git a/agent/call-pinentry.c b/agent/call-pinentry.c
index c6c52be..aecdd6e 100644
--- a/agent/call-pinentry.c
+++ b/agent/call-pinentry.c
@@ -129,7 +129,7 @@ void
agent_query_dump_state (void)
{
log_info ("agent_query_dump_state: entry_ctx=%p pid=%ld popup_tid=%p\n",
- entry_ctx, (long)assuan_get_pid (entry_ctx), (void*)popup_tid);
+ entry_ctx, (long)assuan_get_pid (entry_ctx), (void*)(uintptr_t)popup_tid);
}

/* Called to make sure that a popup window owned by the current


IIUC, you tried to silence the warning of -Wint-to-pointer-cast.

I think that we would need to fix Npth API here, if we want to maximize
clean use of Npth API between different systems. The fundamental
problem is that the type "long" is not compatible to pointer on LLP64 system.


Those problems will be fixed eventually, when GnuPG will be supported on
Windows for 64-bit architecture.

Today, I created: https://dev.gnupg.org/T6227

I have:
https://dev.gnupg.org/T4655
https://dev.gnupg.org/T4656
--

_______________________________________________
Gnupg-devel mailing list
Gnupg-devel@gnupg.org
https://lists.gnupg.org/mailman/listinfo/gnupg-devel
Re: [PATCH gnupg] Fix pointer to integer cast warnings in Windows platform [ In reply to ]
I agree with your decision. The integer to pointer (and vice versa)
conversion warnings are also present in other projects, gnutls, gpgme
etc. I hope those will be fixed also. Thank you for working on this.

_______________________________________________
Gnupg-devel mailing list
Gnupg-devel@gnupg.org
https://lists.gnupg.org/mailman/listinfo/gnupg-devel