What are all the common undefined behaviours that a C++ programmer should know about?
a[i] = i++;
memcpyto copy overlapping buffers.
int64_t i = 1; i <<= 72is undefined)
int i; i++; cout << i;)
sig_atomic_tat the receipt of a signal
The order that function parameters are evaluated is unspecified behavior. (This won't make your program crash, explode, or order pizza... unlike undefined behavior.)
The only requirement is that all parameters must be fully evaluated before the function is called.
// The simple obvious one. callFunc(getA(),getB());
Can be equivalent to this:
int a = getA(); int b = getB(); callFunc(a,b);
int b = getB(); int a = getA(); callFunc(a,b);
It can be either; it's up to the compiler. The result can matter, depending on the side effects.