On Wed, Dec 30, 2009 at 5:32 AM, Brett Nash <n...@nash.id.au> wrote:
> On Wed, 30 Dec 2009 07:51:01 +0100 (CET)
> Vincent Torri <vto...@univ-evry.fr> wrote:
>
>>
>>
>> On Wed, 30 Dec 2009, Vincent Torri wrote:
>>
>> >
>> >
>> > On Wed, 30 Dec 2009, Gustavo Sverzut Barbieri wrote:
>> >
>> >> On Wed, Dec 30, 2009 at 12:07 AM, Enlightenment SVN
>> >> <no-re...@enlightenment.org> wrote:
>> >>> Log:
>> >>>  Fix printing of size_t value(s). (removes compiler warning).
>> >>
>> >> They invented "z" modifier for that, see "man 3 printf"
>>
>> it is also a gnu extension:
>>
>> http://swoolley.org/man.cgi/3/printf
>>
>> "glibc 2.1 adds length modifiers hh,j,t,z and conversion characters
>> a,A."
>
> %z is part of C99.
> So for C99 it's %zi of %zd.
>
> C99 also has the PRIx macros for printing all integer types safely.
>
> Unfortunately there is no safe way of printing it in C89 (ie windows).
> The best way is:
>        printf("... %ld..",(unsigned int)blah);

Given that in many places we use those for logging and logging should
move to EINA_LOG and some systems do not handle "%s" with NULL (ie:
Solaris, BSDs...), isn't it better to follow Glib/Gstreamer logging
and provide our own printf() on these systems, doing clean C99 with
GNU niceness (%s+NULL) and avoid ugly thing spread in code?

I know I already forgot god knows how many %s+NULL in code... it's
easier to copy GNU's printf() or reimplement it than find and fix all
of them.

BR,

-- 
Gustavo Sverzut Barbieri
http://profusion.mobi embedded systems
--------------------------------------
MSN: barbi...@gmail.com
Skype: gsbarbieri
Mobile: +55 (19) 9225-2202

------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to