On Mon, Nov 15, 1999 at 05:48:31PM +0100, Pierre Beyssac wrote:
> The problem is apparently due to the following code fragment:
> 
>         register u_short answer = 0;
> [...]
>         /* mop up an odd byte, if necessary */
>         if (nleft == 1) {
>                 *(u_char *)(&answer) = *(u_char *)w ;
>                 sum += answer;
>         }
> 
> Removing the "register" declaration for 'answer' doesn't help.

That code should not even compile, since standard C says that you
_can't_ derefrence a register variable.  That's about the only
genuine semantic content of the register keyword now.  The fix with
a union (in another message) is the right way to do it, and doesn't
even require that "answer" be in addressable storage.  (I.e., it
can now be optimised into a register).

-- 
Andrew


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message

Reply via email to