4 ms·
Nope, it's UB[0]. While not everything that doesn't work on every platform is UB, plenty of things are. Consider signed integer overflow, which is a common sour
by yoklov 10y ago
Nope, it's UB[0]. While not everything that doesn't work on every platform is UB, plenty of things are. Consider signed integer overflow, which is a common source of UB.
To be clear, UB means the compiler is allowed to e.g. totally remove the call (or really anything else it wants to do at all) if it can be positive that this is what's happening -- not that it will behave as could be expected on the platform, the term for that would be implementation defined behavior.
[0]: http://c0x.coding-guidelines.com/6.3.2.3.html http://c0x.coding-guidelines.com/6.3.2.3.html number 766-768
- _pmf_ 10y agoYou're right.