View Single Post
  #27  
Old February 26th, 2004, 02:01 AM
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

Alexti, your examples are not the same. In the first example: 1) they have void returns and invoke I/O, which the optimizer treats differently. 2) the statements are on separate lines, and IIRC there are various scoping rules to what the compiler will attempt to "consolidate" when it goes to generate machine code.

For the second example: it depends on the switches used. I have seen (though not recently) compilers that would, indeed, consolidate those two statements when you viewed generated assembler code.

However, the most obvious thing you said that bears careful review is the statement "... it's safe to assume ...". It's never safe to assume anything. That's the first step towards making mistakes ...

We've flown the Space Shuttle in cold weather before, and it's only a few degrees colder now, the Challenger should be okay.

It's only a 2-pound chunk of foam. How can that damage reinforced carbon fiber? It probably shattered into dust on impact with the Columbia's wing.

The list of assumptions people make that lead to bad results has a long and inglorious history.
__________________
Visit my Dominions II site
Reply With Quote