| Title: | DECC | 
| Notice: | General DEC C discussions | 
| Moderator: | TLE::D_SMITH N TE | 
| Created: | Fri Nov 13 1992 | 
| Last Modified: | Fri Jun 06 1997 | 
| Last Successful Update: | Fri Jun 06 1997 | 
| Number of topics: | 2212 | 
| Total number of notes: | 11045 | 
    Will the following always be evaluated in the same order
    so that it produces the same result on any platform?
    
    a[i++] = i;
    
    Thanks,
    	Stuart.
| T.R | Title | User | Personal Name | Date | Lines | 
|---|---|---|---|---|---|
| 2160.1 | SPECXN::DERAMO | Dan D'Eramo | Wed Apr 23 1997 15:40 | 3 | |
|         No.  Its behavior is undefined.
        
        Dan
 | |||||
| 2160.2 | We will warn on such cases | DECC::VOGEL | Wed Apr 23 1997 15:43 | 13 | |
|     
    Note that V5.6 of DEC C will issue the following warning for this case:
    
        a[i++] = i;
    ....^
    %CC-W-UNDEFVARFETCH, In this statement, the expression "a[i++]=i" modifies 
    "i", and fetches its value in a computation that is not used to produce the
    modified value without an intervening sequence point.  This behavior is
    undefined.
    
    						Ed
    
    
 | |||||
| 2160.3 | Thanks | CHEFS::DAVIDSONS | Wed Apr 23 1997 15:55 | 1 | |