New answers tagged

1

The AGC is controlled with verbs and nouns The Apollo command software is not written in any syntax users would recognize today. Astronauts input commands numerically, with each two-digit number representing a verb or a noun. The verb described the action to be performed, and the noun specified the data to be affected by the verb’s action. Astronauts hated ...


0

The answers seem pretty consistent but missing an important point. You are telling the compiler that you want to to allocate space and for every access, read OR WRITE, you want it to perform that access. We dont want it to optimize away those accesses or that variable for some reason. Yes, one reason is because someone else might change that value for ...


2

Abstract explanation Both C and C++ have a concept of an abstract machine. When the code uses the value of some variable, the abstract machine says the implementation has to access the value of that variable. Code of the form statement_A; statement_B; statement_C; has to be executed in exactly the order specified. Expressions common to those three statements ...


0

(non-)volatile is a hint for the compiler how to optimize code (from generated assembly-code point of view): non volatile means that your current compiler decides where the variable will be located or how the variable-s value is teransfered to a subroutine in a fixed memory adress, on the stack [relative to the processors current stackpointer], on the ...


0

There is just one security risk: The fact that there are people outside who will do their best to catch any vulnerability in your software and to exploit it for their own gain. Everything else follows from there. So when you think "nobody in their right mind would ... ", then you need to think immediately "except someone who wants to hack into other ...


10

volatile means two things: The value of the variable may change without any code of yours changing it. Therefore whenever the compiler reads the value of the variable, it may not assume that it is the same as the last time it was read, or that it is the same as the last value stored, but it must be read again. The act of storing a value to a volatile ...


8

volatile means some other processor or I/O device or something can change the variable out from under you. With an ordinary variable, your program's steps are the only thing that will change it. So for instance if you read 5 from a variable and you don't change it, it'll still contain 5. Since you can rely on that, your program doesn't have to take the time ...



Top 50 recent answers are included