3 ms·
While the C standard does say that integer promotion happens, if the result is being cast back to char again, a C compiler will see that it doesn't need to oper
by gsliepen 4y ago
While the C standard does say that integer promotion happens, if the result is being cast back to char again, a C compiler will see that it doesn't need to operate on 16 bits and is allowed to optimize the result back to 8 bit operations. See for example: https://godbolt.org/z/zM8reeqrc https://godbolt.org/z/zM8reeqrc