|
|
|
|
|
by AlotOfReading
678 days ago
|
|
The first has no UB, but this trivial modification does: unsigned short mul(unsigned short x, unsigned short y) { return x * y; } I don't know about you, but I wouldn't think to treat these any differently unless I put on my language lawyer hat. |
|
But I also do not worry about signed overflow anyhow, because compilers can turn them into traps.