News for hackers. Stuff that matters.
Re:Essential C [pdf] by tialaramex on Sunday March 06, 2022 @03:32PM (#30580985)
It's downright perverse to insist that you should be able to assume all accesses are volatile reads/ stores just because that was momentarily convenient.

C lacks the intrinsics you'd actually want for this (explicit load/ store of various machine sizes) but it does provide the "volatile" storage qualifier which is what you should be using to do what you apparently wanted in C today. It makes no sense to demand everybody else writes some sort of "not-volatile" qualifier in front of every variable to tell the compiler that actually this is just a variable and it's OK to optimise.

There are no comments on this comment yet.