View Single Post
  #37  
Old February 26th, 2004, 12:32 PM
Arryn's Avatar

Arryn Arryn is offline
Major General
 
Join Date: Jan 2004
Location: twilight zone
Posts: 2,247
Thanks: 0
Thanked 0 Times in 0 Posts
Arryn is on a distinguished road
Default Re: 2.08 and Incompatible Battle Reports

Philippe, "side effect" is the correct translation, AFAIK.

And I'm glad that at least one person who's been reading this thread "gets it" with regards to compiler optimization, and possible pitfalls. Thanks for posting.

BTW, AFAIK, there aren't any C/C++ keywords that affect the sort of optimizations that can cause these troubles. The best way to avoid them is understanding how functions pass back values, most importantly, what all the various optimization switches do (and which ones you have turned "on"), and how the compiler actually optimizes the code (which is done at the assembly-code level, not source-code level).

Breaking complex expressions into separate and simple statements will go a long ways to avoiding possible problems too. It takes a little longer to write the code, but the end result is easier to read and maintain.
__________________
Visit my Dominions II site
Reply With Quote