https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90081
--- Comment #5 from Guy Perfect <bafap5 at yahoo dot com> --- (In reply to Harald van Dijk from comment #4) That was my line of thinking: supplying a cast in the macro. Even in the case of negative values being cast to unsigned types, the language spec provides a rule for that, so the behavior is defined independent of the implementation: "[... T]he value is converted to unsigned by adding to it one greater than the largest number that can be represented in the unsigned integer type." and "In a two's-complement representation, there is no actual change in the bit pattern except filling the high-order bits with copies of the sign bit if the unsigned integer has greater size." I think the ticket was marked "resolved invalid" prematurely, as there's clearly a meaningful problem and a meaningful solution.