|
|
|
|
|
by nlitened
396 days ago
|
|
> C programmers, then `int x;` can either have a value which is just not known at compile time I am pretty sure that in C, when a program reads uninitialized variable, it is an "undefined behavior", and it is pretty much allowed to be expected to crash — for example, if the variable turned out to be on an unallocated page of stack memory. So literally the variable does not have a value at all, as that part of address space is not mapped to physical memory. |
|
> So literally the variable does not have a value at all, as that part of address space is not mapped to physical memory.
There are vanishingly few platforms where the stack you have in a C program maps to physical memory (even if you consider pages from the OS)