Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 11 Mar 2015 18:29:39 +0000
From:      Anuranjan Shukla <anshukla@juniper.net>
To:        hiren panchasara <hiren@strugglingcoder.info>, Simon Gerraty <sjg@juniper.net>
Cc:        "freebsd-arch@freebsd.org" <freebsd-arch@freebsd.org>
Subject:   Re: Buggy sbspace() on 64bit builds?
Message-ID:  <D125D73E.27771%anshukla@juniper.net>
In-Reply-To: <20150311182612.GL88380@strugglingcoder.info>
References:  <D0F95E21.2489D%anshukla@juniper.net> <20150206183036.S1246@besplex.bde.org> <D0FA7C7B.249B1%anshukla@juniper.net> <5977.1423271024@chaos> <20150311182612.GL88380@strugglingcoder.info>

next in thread | previous in thread | raw e-mail | index | archive | help
Hi Hiren,
It's been committed to HEAD, r278729.

Thanks.

On 3/11/15, 11:26 AM, "hiren panchasara" <hiren@strugglingcoder.info>
wrote:

>On 02/06/15 at 05:03P, Simon J. Gerraty wrote:
>> Anuranjan Shukla <anshukla@juniper.net> wrote:
>> > this, along with return value being 'int' acceptable as a final
>> > determination?
>>=20
>> It is ok for the function to return long,
>> so long as an int is used internally.
>> Casting the int to long - implicit on return does no harm.
>>=20
>> #include <stdio.h>
>> #include <sys/types.h>
>> #include <unistd.h>
>>=20
>> int
>> main(int argc, char *argv[])
>> {
>>     uint a, b;
>>     long r1;
>>     int r2;
>>=20
>>     a =3D 1;
>>     b =3D 2;
>>=20
>>     r1 =3D a - b;
>>     r2 =3D a - b;
>>=20
>>     printf("r1=3D%ld\nr2=3D%d\nr3=3D%ld\n", r1, r2, (long)r2);
>>     exit(0);
>> }
>>=20
>> r1=3D4294967295
>> r2=3D-1
>> r3=3D-1
>>=20
>> so I think just using 'int' internally should work for now,
>> perhaps with a comment saying the object size should match
>> those being subtracted etc.
>
>Hi Simon/Anu,
>
>Has this been committed yet? I believe I am running into something
>similar in our stable10 build. I am not certain though. In any case,
>this should be committed/mfc'd.
>
>Cheers,
>Hiren




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?D125D73E.27771%anshukla>