Re: r272867 - [Lex] Try to fix a 'comparison is always false' warning. NFC.

2016-06-16 Thread David Blaikie via cfe-commits
ah, rightio - thanks for the reminder! On Thu, Jun 16, 2016 at 10:44 AM, George Burgess IV < george.burgess...@gmail.com> wrote: > I don't think so -- 4.7p2 says "If the destination type is unsigned, the > resulting value is the least unsigned integer congruent to the source > integer (modulo 2 n

Re: r272867 - [Lex] Try to fix a 'comparison is always false' warning. NFC.

2016-06-16 Thread George Burgess IV via cfe-commits
I don't think so -- 4.7p2 says "If the destination type is unsigned, the resulting value is the least unsigned integer congruent to the source integer (modulo 2 n where n is the number of bits used to represent the unsigned type). [ Note: In a two’s complement representation, this conversion is con

Re: r272867 - [Lex] Try to fix a 'comparison is always false' warning. NFC.

2016-06-16 Thread David Blaikie via cfe-commits
I can't remember the rules - but wouldn't this produce UB on a signed char platform in the case where Ch is negative? (or is that just unspecified? implementation defined?) On Wed, Jun 15, 2016 at 7:30 PM, George Burgess IV via cfe-commits < cfe-commits@lists.llvm.org> wrote: > Author: gbiv > Dat