Dan Anderson wrote:
> On Thu, 28 Aug 2008, Garrett D'Amore wrote:
>   
>> You can cast through a void * to eliminate the error.
>>   -- Garrett
>>     
>
> Hmmm.  OK--tell me how.  It's already being cast.  Here's some real examples, 
> given:
>               uint32_t left;
>               uint8_t *block;
>
> 402         /* LINTED E_BAD_PTR_CAST_ALIGN */
> 403         left = htonl(*(uint32_t *)&block[0]);
>   

Try like this (yeah, kind of ugly to use two step casts like this):

    left = htonl(*(uint32_t *)(void *)&block[0]);

    -- Garrett

> . . .
> 452                 /* LINTED E_BAD_PTR_CAST_ALIGN */
> 453                 *(uint32_t *)&block[0] = htonl(left);
> --
> This message posted from opensolaris.org
> _______________________________________________
> crypto-discuss mailing list
> crypto-discuss at opensolaris.org
> http://mail.opensolaris.org/mailman/listinfo/crypto-discuss
>   


Reply via email to