[PATCH] Suppress a warning about mismatched parameter in format string (expected long int, provided unsigned int).

Giuseppe Bilotta giuseppe.bilotta at gmail.com
Wed Apr 25 05:17:15 PDT 2007


On 4/25/07, Zephaniah E. Hull <warp at aehallh.com> wrote:
> On Wed, Apr 25, 2007 at 03:06:27AM +0200, Giuseppe Bilotta wrote:
> > -            xf86Msg(X_ERROR, "Read error: %s (%d, %d != %ld)\n",
> > +            xf86Msg(X_ERROR, "Read error: %s (%d, %d != %u)\n",
> >                   strerror(errno), errno, len, sizeof (ev));
>
> See, this is one of those funky cases where fixing the warning is the
> wrong answer.
>
> See, on x86 sizeof returns an int, on amd64 sizeof returns a long, which
> makes it slightly harder to avoid a warning on all systems without using
> a cast.

By the way, shoudln't len be declared as size_t rather than int?

-- 
Giuseppe "Oblomov" Bilotta



More information about the xorg mailing list