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, 07:48 UTC
Message-ID
<7v8wewq7rb.fsf@alter.siamese.dyndns.org>
In-Reply-To
<7vljiwq8tc.fsf@alter.siamese.dyndns.org>
Junio C Hamano <gitster@pobox.com> writes:
Show 16 quoted lines
> Vietor Liu <vietor@vxwo.org> writes:
>
>> Fixes some compiler warnings:
>> imap-send.c: In function ‘ssl_socket_connect’:
>> warning: assignment discards qualifiers from pointer target type
>>
>> ====================================================
>> OpenSSL Changes between 0.9.8k and 1.0:
>>
>> *) Let the TLSv1_method() etc. functions return a 'const' SSL_METHOD
>>      pointer and make the SSL_METHOD parameter in SSL_CTX_new,
>>      SSL_CTX_set_ssl_version and SSL_set_ssl_method 'const'.
>>
>> Signed-off-by: Vietor Liu <vietor@vxwo.org>
>
> This is much easier to understand.

This indeed _is_ easier to understand, but what this means is that making "meth" const will break the compilation for people with 0.9.8k.

Their SSL_CTX_new() does not promise the callers that it won't modify the object its parameter points at, so SSL_CTX_new(meth) will now see exactly the same issue. You will be discarding "const" qualifier by passing it.

Previous: Junio C Hamano
Message 3 of 3 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. Junio C HamanoOct 28, 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.