msync on Hurd, dev_t on MIPS

Julien ÉLIE julien at trigofacile.com
Fri Apr 15 21:13:11 UTC 2016


Following a very old discussion (2009/11/03)...
Russ Allbery wrote:
>> Debian build of INN 2.5.1
>
>> On MIPS, we have:
>
>> hisv6/hisv6.c: In function 'hisv6_closefiles':
>> hisv6/hisv6.c:272: warning: large integer implicitly truncated to unsigned type
>> hisv6/hisv6.c: In function 'hisv6_new':
>> hisv6/hisv6.c:480: warning: large integer implicitly truncated to unsigned type
>
>> It corresponds to the cast to dev_t:
>>     h->st.st_dev = (dev_t)-1;
>
>> How can we change that?
>
> That's an odd one.  I'm not sure what to make of that error.  It sounds
> almost like st_dev isn't a dev_t, but that doesn't make any sense to me.
> You should be able to cast -1 to an unsigned type; that's a common C
> idiom.

I've just came across that warning again, and found the explanation:
     https://lists.debian.org/debian-mips/2011/11/msg00006.html
     https://lists.debian.org/debian-mips/2015/09/msg00068.html

"for historical reasons mips (o32) defines struct stat with a 32-bit 
dev_t even though it defines dev_t to be 64-bits.  It's been
defined this way since at least 1997 when mips was added to glibc"

So we're casting -1 to (unsigned long long) and then assigning it to 
(unsigned long) on MIPS.


As Russ suggested, changing
     h->st.st_dev = (dev_t)-1;
to
     h->st.st_dev = (unsigned long)-1;

fixes the issue, so I'll commit that change.

-- 
Julien ÉLIE

« Être øu ne pås être, telle est lå questiøn… » (Kerøzen)


More information about the inn-workers mailing list