cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: [patches] Minor examples / documentation related changes

From: Brad Hards <bradh_at_frogmouth.net>
Date: Sun, 19 Dec 2010 09:31:15 +1100

On Sunday, December 19, 2010 03:20:08 am Daniel Stenberg wrote:
> > 0002 is a warnings fix for printf with size_t arguments (in examples
> > code)
>
> The 'z' flag isn't C90 kosher so I didn't apply that one. I think we need
> to opt for a typecast rather to make it C90 compliant. We have a printf()
> clone provided in libcurl, but I don't want to encourage apps to use that
> so I don't think using that is a good idea even if it would a way to avoid
> this issue.
OK, I did see use of %zu and %zd in other parts of libcurl, so I assumed that
it would be OK in this case too. Perhaps the examples can assume C99?

The only other way I can see is to write <intttypes.h> style macros (like
PRI_size_t_d and PRI_size_t_h) which use the z flag if C99, and just omit it
for C89/C90. Its still going to be ugly though.
 
Brad
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2010-12-18