> Date: Sat, 19 Feb 2011 15:04:24 +0100
> From: Julien Cristau <[email protected]>
> 
> > diff --git a/test/FSGetErrorText.c b/test/FSGetErrorText.c
> > index 31523c6..f9a88d2 100644
> > --- a/test/FSGetErrorText.c
> > +++ b/test/FSGetErrorText.c
> > @@ -40,7 +40,7 @@ CheckErrorMessage(FSServer *srv, int code, const char 
> > *codestr)
> >  
> >      if (!FSGetErrorText(srv, code, buf, sizeof(buf))) {
> >     fprintf(stderr, "FSGetErrorText(srv, %s (%d), buf, %d) failed",
> > -           codestr, code, sizeof(buf));
> > +           codestr, code, (int) sizeof(buf));
> >     return 0;
> >      }
> >  
> Or you could use %zu in the format string and avoid the cast?

That's certainly more elegant, but the 'z' modifier is a C99 feature
and I'm not completely sure all supported platforms support it.  In
particular the Solaris 9 printf(3C) man page seems to suggest it
doesn't.  OpenBSD does support it, so in that sense I don't have any
objection.
_______________________________________________
[email protected]: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Reply via email to