3 ms·
Although I guess you could just rely on promotion here if you can rely on the unsignedness of char If compilers did not do promotion, they would be very obviou
by userbinator 10y ago
Although I guess you could just rely on promotion here if you can rely on the unsignedness of char
If compilers did not do promotion, they would be very obviously not compliant with the C standard and unable to compile correctly most existing code, so I'm willing to bet that is something you can rely on. It's defined by the standard and widely used.
- audidude 10y agoSure, but in this case it was signed to unsigned promotion.
- blechschmidt 10y agoWhy should that matter in this case? The worst case would have been the output of a wrong value and it was some commented out debug output which I have used in a very specific case.
- audidude 10y agoTotally, just wrong value. This thread is already making a bigger deal of it than I expected it to.