On Wed, Dec 30, 2009 at 10:44:23AM -0200, Gustavo Sverzut Barbieri wrote:
> > Unfortunately there is no safe way of printing it in C89 (ie windows).
> > The best way is:
> > printf("... %ld..",(unsigned int)blah);
%ld and unsigned int? You must be joking... Defining PRIdMAX and friends
can be easily automated.
> 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?
IMO it is still better to fix the programs. Besides, printf with NULL is
checked for on many systems (like the BSDs), the real problem is that
GCC sometimes decides to replace printf with fputs, which doesn't...
Get latest updates about Open Source Projects, Conferences and News.