Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 16 Jun 2001 11:09:40 -0500
From:      Jonathan Lemon <jlemon@flugsvamp.com>
To:        Jonathan Lemon <jlemon@FreeBSD.org>, cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org
Subject:   Re: cvs commit: src/usr.sbin/rarpd rarpd.c
Message-ID:  <20010616110940.G68883@prism.flugsvamp.com>
In-Reply-To: <20010616180611.B1956@ringworld.oblivion.bg>
References:  <200106160640.f5G6e4J30312@freefall.freebsd.org> <20010616180611.B1956@ringworld.oblivion.bg>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, Jun 16, 2001 at 06:06:11PM +0300, Peter Pentchev wrote:
> On Fri, Jun 15, 2001 at 11:40:04PM -0700, Jonathan Lemon wrote:
> > jlemon      2001/06/15 23:40:04 PDT
> > 
> >   Modified files:
> >     usr.sbin/rarpd       rarpd.c 
> >   Log:
> >   Undo last braino and fix properly.
> 
> I somewhat fail to see how this is a proper fix.  'len' is u_int,
> sizeof is size_t, both are unsigned types.  You've left len as-is,
> casted the sizeof to (int), and printed both as signed ints.

Yes - sizeof() appears to be a 'long int' on the alpha, but an 'int'
on the i386.

     printf("%d", sizeof(x));

produces the following warning on the alpha

     warning: int format, different type arg (arg 2)

changing the format specifier to "%ld" fixes the warning, but then
i386 complains:

     warning: long int format, int arg (arg 2)

So my solution was simply to cast sizeof() to int.  u_int will work
too; the main thing here is to get the size to match on the alpha.
-- 
Jonathan

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe cvs-all" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010616110940.G68883>