[OpenAFS] Strange access problems on one client
Derrick Brashear
shadow@gmail.com
Thu, 11 Oct 2007 22:54:12 -0400
------=_Part_10227_22493546.1192157652333
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
You wacky kids and your excessive widereplies.
Anyway, if I have time to do testing, I will. Otherwise, if someone wants to
do a clean version of this, please do.
On 10/11/07, Carson Gaspar <carson@taltos.org> wrote:
>
> Hans-Werner Paulsen wrote:
> > On Sun, Oct 07, 2007 at 01:15:00PM -0400, Marc Dionne wrote:
>
> >> + else if (hval >= 1<<31)
>
> > this patch is fine for architectures where the size of "unsigned long"
> > is 4 bytes. But on the x86_64 architecture this will not work, because
> > the size is 8 bytes. One can use "unsigned int".
>
> Ummm... no. This whole thing is way too fragile. If you care about how
> many bits the variable has, you MUST use something like uint32_t. Or you
> can not care, and use sizeof() to generate your comparison. But you MUST
> NOT use "int" or "long" and hard-code bit shifts.
>
>
------=_Part_10227_22493546.1192157652333
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
You wacky kids and your excessive widereplies.<br><br>Anyway, if I have time to do testing, I will. Otherwise, if someone wants to do a clean version of this, please do.<br><br><div><span class="gmail_quote">On 10/11/07, <b class="gmail_sendername">
Carson Gaspar</b> <<a href="mailto:carson@taltos.org">carson@taltos.org</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hans-Werner Paulsen wrote:<br>> On Sun, Oct 07, 2007 at 01:15:00PM -0400, Marc Dionne wrote:<br><br>>> + else if (hval >= 1<<31)<br><br>> this patch is fine for architectures where the size of "unsigned long"
<br>> is 4 bytes. But on the x86_64 architecture this will not work, because<br>> the size is 8 bytes. One can use "unsigned int".<br><br>Ummm... no. This whole thing is way too fragile. If you care about how
<br>many bits the variable has, you MUST use something like uint32_t. Or you<br>can not care, and use sizeof() to generate your comparison. But you MUST<br>NOT use "int" or "long" and hard-code bit shifts.
<br><br></blockquote></div><br>
------=_Part_10227_22493546.1192157652333--