Re: 2.08 and Incompatible Battle Reports
alexti --
If memory serves, there's no standard way to specify to a compiler that a given C function has no side-effects. Function calls should not be automatically collated unless the code is inlined, in which case it may be possible. There might be a way to search the transitive closure of a function, so long as the closure resides within a given source file, for unsafe operations (assignments to non-local variables, assorted pieces of assembler, function calls outside file, I/O...) but that would seem like an awful headache for a compiler designer to consider in light of the fact that the original programmer could easily handle the job himself by calling the function once and assigning the result to a variable, then assigning a second variable the same value as the first.
__________________
Are we insane yet? Are we insane yet? Aiiieeeeee...
|