Quantcast
Channel: Active questions tagged gcc - Stack Overflow
Viewing all articles
Browse latest Browse all 22133

Is 0u defaulting to a signed int?

$
0
0

The following code triggers a signed unsigned comparison warning:

uint16 x = 5;if(((x) & (uint16)0x0001u) > 0u) {...}

Replacing the if with this eliminates the warning:

if(((x) & (uint16)0x0001u) > (uint8)0u) {...} //No warning

Shouldn't 0u become an unsigned integer and not trigger this warning to begin with?


Viewing all articles
Browse latest Browse all 22133

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>