git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] imap-send.c: fix pointer to be const

From
Junio C Hamano <gitster@pobox.com>
Date
Oct 28, 2009, 17:56 UTC
Message-ID
<7vhbtjo10s.fsf@alter.siamese.dyndns.org>
In-Reply-To
<4AE8482F.7020807@drmicha.warpmail.net>
Michael J Gruber <git@drmicha.warpmail.net> writes:
> Since this is only about warnings, maybe git 1.7.0 is the right time
> frame to adjust this to the upcoming standard?

This does not look like "one group wants this way, but the others want differently. We have to pick one and sacrifice the other because it is impossible to have it both ways"; there is no excuse to bring up 1.7.0 for something like this.

Doesn't inclusing "ssl.h" give us some indication whether "const" is needed to allow us to use #if/#else/#endif in order to compile with headers from either versions? I.e. something like...

diff --git a/imap-send.c b/imap-send.c
index 3847fd1..a199db8 100644
--- a/imap-send.c
+++ b/imap-send.c
@@ -273,7 +273,11 @@ static int ssl_socket_connect(struct imap_socket *sock, int use_tls_only, int ve
 	fprintf(stderr, "SSL requested but SSL support not compiled in\n");
 	return -1;
 #else
+#if (OPENSSL_VERSION_NUMBER >= 0x1000000fL)
+	const SSL_METHOD *meth;
+#else
 	SSL_METHOD *meth;
+#endif
 	SSL_CTX *ctx;
 	int ret;
 
Previous: Michael J GruberNext: Vietor Liu
Message 5 of 6 in “imap-send.c: fix pointer to be const”
  1. imap-send.c: fix pointer to be constVietor Liu, Oct 28, 2009
  2. Junio C HamanoOct 28, 2009
  3. Vietor LiuOct 28, 2009
  4. Michael J GruberOct 28, 2009
  5. Junio C HamanoOct 28, 2009
  6. Vietor LiuOct 29, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.