cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: examples compiler warnings

From: Yang Tse <yangsita_at_gmail.com>
Date: Thu, 22 Sep 2011 23:50:55 +0200

2011/9/22 Guenter <lists_at_gknw.net>:
> What speaks against having a proper format define in curlbuild.h? configure
> could easily detect sizeof(size_t) and set the format define correctly, or?

When you #include <curl/curl.h> you already get following defines:

CURL_SIZEOF_LONG
CURL_SIZEOF_CURL_OFF_T
CURL_FORMAT_CURL_OFF_T
CURL_FORMAT_CURL_OFF_TU

Proper format for size_t can be derived from that and a sizeof(size_t)
check in whatever source needs it.

sizeof(size_t) > CURL_SIZEOF_LONG -> use CURL_FORMAT_CURL_OFF_T
otherwise
use %ld

If compiler warnings in examples aren't important, I suppose it
doesn't even justify modification (addition) of external API symbols
to curl.h via curlbuild.h

-- 
-=[Yang]=-
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2011-09-22