News for hackers. Stuff that matters.
Re:What is C in practice? by jacquesm on Monday June 29, 2015 @03:43PM (#9800418)
And you might want to access a memory location legitimately that was not written by this program, for instance a chunk of dual-port memory, a shared memory block, a piece of memory mapped hardware and so on.

In those cases some compiler override could provide the solution, while still allowing the compiler to flag all the other cases as errors.

Re:What is C in practice? by im3w1l on Tuesday June 30, 2015 @01:10AM (#9803067)
Your examples are not expected to work unless you specifically ask the compiler for it.

If you use the volatile key word, then you are guaranteed that all reads and stores will actually happen and not be optimized out. But volatile still allows non-atomicity and reordering so you probably want something which prohibits that too.

Re:What is C in practice? by anon4 on Tuesday June 30, 2015 @01:59AM (#9803212)
You mean volatile memory?
Re:What is C in practice? by aidenn0 on Tuesday June 30, 2015 @12:54AM (#9803020)
None of those are going to be autos though, so the behavior isn't undefined.