cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: High number of conversion warnings compiling for 64bit Windows using MinGW

From: Marc Hörsken <info_at_marc-hoersken.de>
Date: Tue, 6 Jan 2015 01:48:50 +0100

Hi Steve,

> If we can - I think it would be worth it.
>
> If we are doing things like "int..." or "long len = strlen(string);" then we should be using the right type.
>
> If these sort of warnings are as a result of the values being passed into curl functions that accept "long" parameters, for example via curl_easy_setopt(), then we can use the warnless functions ;-)

I am currently investigating the source of these warnings, since I could not find the related source code within the repository.

It seems like they are actually introduced by libtool / ltmain.sh in the libtoolized source code generated during the buildconf.

Please see the following detailed warnings:

./.libs/lt-curl.c: In function 'main':
./.libs/lt-curl.c:330:3: warning: conversion to 'int' from 'intptr_t' may alter its value [-Wconversion]
return rval;
^
./.libs/lt-curl.c: In function 'find_executable':
./.libs/lt-curl.c:473:15: warning: conversion to 'int' from 'size_t' may alter its value [-Wconversion]
tmp_len = strlen (tmp);
^
./.libs/lt-curl.c:499:13: warning: conversion to 'int' from 'size_t' may alter its value [-Wconversion]
tmp_len = strlen (tmp);
^
./.libs/lt-curl.c: In function 'lt_setenv':
./.libs/lt-curl.c:649:15: warning: conversion to 'int' from 'size_t' may alter its value [-Wconversion]
int len = strlen (name) + 1 + strlen (value) + 1;
^
./.libs/lt-curl.c: In function 'lt_extend_str':
./.libs/lt-curl.c:666:28: warning: conversion to 'int' from 'size_t' may alter its value [-Wconversion]
int orig_value_len = strlen (orig_value);
^
./.libs/lt-curl.c:667:21: warning: conversion to 'int' from 'size_t' may alter its value [-Wconversion]
int add_len = strlen (add);
^
./.libs/lt-curl.c: In function 'lt_update_exe_path':
./.libs/lt-curl.c:698:17: warning: conversion to 'int' from 'size_t' may alter its value [-Wconversion]
int len = strlen (new_value);
^
./.libs/lt-curl.c:699:22: warning: conversion to 'int' from 'size_t' may alter its value [-Wconversion]
while (((len = strlen (new_value)) > 0) && IS_PATH_SEPARATOR (new_value[len-1]))
^

All of these code parts can be found within libtool / ltmain.sh.
So it may be something that already was or still needs to be fixed upstream within libtool.

I guess I will finally have to try the more recent MSYS2 and MinGW-w64 toolchains on Windows...

> I've been focused on reducing the warnings in the auto builds myself, in particularly those from Dan F's builds, and some that I can't remember now, as well as the recent spike in warnings from smb.c. Next on my list was to try and compile the test server (under Visual Studio if I can) and look at those, then the libcurl unit test and finally the examples but any assistance would be great as I don't know how much work it will be to get the test server into the Visual Studio project files will be yet.

Sounds great, let me know if you run into any trouble and I can be of any specific help. ;-)

Best regards,
Marc
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2015-01-06