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

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

From
Michael J Gruber <git@drmicha.warpmail.net>
Date
Oct 28, 2009, 13:33 UTC
Message-ID
<4AE8482F.7020807@drmicha.warpmail.net>
In-Reply-To
<1256713526.3333.0.camel@localhost.localdomain>
Vietor Liu venit, vidit, dixit 28.10.2009 08:05:
Show 35 quoted lines
> On Tue, 2009-10-27 at 23:26 -0700, Junio C Hamano wrote:
>> 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
>>>
>>> Signed-off-by: Vietor Liu <vietor@vxwo.org>
>>
>> I do not quite understand.  This variable gets assigned the return values
>> from TLSv1_method() or SSLv23_method(), but the copy of ssl.h I have
>> declares them as:
>>
>>     SSL_METHOD *SSLv23_method(void);	/* SSLv3 but can rollback to v2 */
>>     SSL_METHOD *TLSv1_method(void);		/* TLSv1.0 */
> 
> 1. openssl-devel-1.0.0-0.10
> 
> const SSL_METHOD *SSLv23_method(void);	/* SSLv3 but can rollback to v2
> */
> const SSL_METHOD *TLSv1_method(void);		/* TLSv1.0 */
> 
> 
> 2. http://www.openssl.org/docs/ssl/ssl.html
> 
> const SSL_METHOD *SSLv2_method(void);
>         
>         Constructor for the SSLv2 SSL_METHOD structure for combined
>         client and server.
> const SSL_METHOD *TLSv1_method(void);
>         
>         Constructor for the TLSv1 SSL_METHOD structure for combined
>         client and server.
> 
> 3. it maybe fixes warnings for other version.

No const here with openssl 0.9.8k. I think major distros will switch to 1.0.0 with their next major release (e.g. Fedora 12 will have it by the end of this year).

Since this is only about warnings, maybe git 1.7.0 is the right time frame to adjust this to the upcoming standard?

Michael
Previous: Vietor LiuNext: Junio C Hamano
Message 4 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.