64bit capability bug

Derrick J Brashear shadow at dementia.org
Sun Jan 9 22:19:40 EST 2005


On Tue, 4 Jan 2005, Derrick J Brashear wrote:

>> --- lib/imapopts.h.orig Fri Dec 31 10:19:47 2004
>> +++ lib/imapopts.h      Fri Dec 31 10:20:13 2004
>> @@ -200,9 +200,9 @@
>> 
>>        const char *s;
>> 
>> -       int i;
>> +       long i;
>> 
>> -       int b;
>> +       long b;
>> 
>>        enum enum_value e;
>> 
>
> given that e.g. config_getint returns int, still, this isn't really the right 
> fix. i willhave one shortly.

Or not. I need to think some more. See, the thing is:
union config_value {
        void *dummy;
        const char *s;
        int i;
        int b;
        enum enum_value e;
};

and so the thing we use when we initialize from an array is treated as of 
the first union type, a void*, or, on a 64 bit big endian platform, 
something which results in us being screwed when we read an int out. 
simply converting i and b to longs will fix the issue, but means 
carelessness may cause a truncation later from e.g. config_getint. So I'm 
stuck either switching to config functions which return longs (and 
associated code changes), fixing this some other way, or just sucking it 
up and switching i and b to long, and taking the risk.

I need to think some more.

---
Cyrus Home Page: http://asg.web.cmu.edu/cyrus
Cyrus Wiki/FAQ: http://cyruswiki.andrew.cmu.edu
List Archives/Info: http://asg.web.cmu.edu/cyrus/mailing-list.html




More information about the Info-cyrus mailing list