[x264-devel] shift count >= width of type is not non-portable C, and even with GCC, introduces bugs

Leon Woestenberg leon.woestenberg at gmail.com
Fri Dec 12 19:13:05 CET 2008


./common/osdep.h:166: warning: right shift count >= width of type

        return endian_fix32(x>>32) + ((uint64_t)endian_fix32(x)<<32);

A proper fix is to shift twice, 16 positions on each shift. "shift
count >= width of type" is not non-portable C, and even with GCC,
introduces bugs on some platforms.


(Normally I would add a patch, I am unsure about the precedence of
cast versus shift operators in the second argument to the addition.)

Regards,
-- 
Leon


More information about the x264-devel mailing list