On Mar 23, 2017, at 3:45 AM, David W. Schultz <david.schu...@earthlink.net> 
wrote:

> Making TXByte a signed int makes this go away. (The MSP430 doesn't have
> a single instruction to do the unsigned right shift.) You don't need for
> it to be unsigned because you don't care about those bits.

Why does it need to be a “single instruction” for the compiler to create inline 
code for the shift
(two instruction: "clrc; rrc", right) instead of pulling in (apparently) a 
library that includes code for every possible shift count and size?

Also: 
https://www.securecoding.cert.org/confluence/display/c/INT13-C.+Use+bitwise+operators+only+on+unsigned+operands

BillW


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Mspgcc-users mailing list
Mspgcc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mspgcc-users

Reply via email to