Consider the following example:
{
int x;
(void)x; // silence the "unused" warning
...
}
Does this lead to undefined behavior due to x being read uninitialized? If yes, then does this mean that in the following code a memory read instruction (to read the pointee) must be emitted by the compiler?
volatile char* p=getP();
(void)*p;
I'm interested in both the C and C++ rules regarding this, in case they differ.