3 ms·
> The whole program could be a lie, cleverly calculated to mimic the one you really intended. The standard has a similarly convoluted way of saying that, in a
by dom0 10y ago
> The whole program could be a lie, cleverly calculated to mimic the one you really intended.
The standard has a similarly convoluted way of saying that, in a nutshell, C compilers are permitted all optimizations under the as-if rule. (§ 5.1.2.3)
- bluetomcat 10y agoThe "canonical" mental memory model of C (globals in data/BSS, locals on the stack, memory is a big array, code and data are the only artifacts) may be utterly useless when reasoning about the performance of a program, but helps the programmer greatly when approaching a problem. The language was designed with these things in mind, no matter how much more sophisticated compilers and hardware have become, and no matter how much language lawyer fetishists frown on you for saying "this is on the stack" instead of "this has automatic storage duration".