.com.unity Forums
  The Official e-Store of Shrapnel Games

This Month's Specials

Air Command 3.0- Save $12.00
War Plan Pacific- Save $7.00

   







Go Back   .com.unity Forums > Illwinter Game Design > Dominions 2: The Ascension Wars

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #35  
Old February 27th, 2004, 02:13 AM

alexti alexti is offline
First Lieutenant
 
Join Date: Dec 2003
Location: Calgary, Canada
Posts: 762
Thanks: 0
Thanked 0 Times in 0 Posts
alexti is on a distinguished road
Default Re: 2.08 and Incompatible Battle Reports

Quote:
Originally posted by Arryn:
quote:
Originally posted by alexti:
The idea of the standards is to be able to write code which will work correctly (meaning that as programmer specified in the source code - as opposite to what the programmer wants ) if compiled by any standard-compliant compiler.
The C/C++ standards do not address the issue that's been the focus of this interminable discussion. So your argument is sort of irrelevant.
That's exactly the point. If C/C++ standard does not specify the order of evaluation (I haven't seen it there, but it doesn't mean that it's not there though ) you can not rely on any particular order.
In the following example you can't rely on whether left call or right call will be evaluated first, but you can rely that both of them will be evaluated.
code:
  int print_empty_line()
{
printf("\n");
return 1;
}

void foo(int x)
{
if (x + print_empty_line() < 2 + print_empty_line())
...
}

Quote:
quote:
Optimizer should meet all criteria defined in the language standard concerning the produced binary code, so the only case when it is allowed to alter the results is when the programmer is using constructs which behaviour is undefined by the standard. And the programmer should not be using such constructs.
1) The compiler does comply with the standard.

Which case you considering? Concerning evaluation order it's standard-compliant, but if it replaces 2 calls with one, it's not.
Reply With Quote
 

Bookmarks


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT -4. The time now is 01:46 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©1999 - 2025, Shrapnel Games, Inc. - All Rights Reserved.