Gerald Pfeifer gerald@pfeifer.com writes:
In ISO C, operations involving both signed and unsigned types are using signed. If the case of ui = ui OP si is really ment to make use of this (despite the result being stored in an unsigned type), we'd need to handle this via two casts, but I doubt this is really the intent here.
It's supposed to follow the C rules, so yes the result most likely needs to be signed in this case. That doesn't mean using two casts, it means using the correct output type.