精華區beta C_and_CPP 關於我們 聯絡資訊
doomleika:我自己是覺得如果有compiler在出現像是undefined 02/04 09:17
doomleika:或unspecified的code時跳一個warning會比較好 02/04 09:17
doomleika:不過看起來好像都沒有T_T_ 02/04 09:18
哈哈,doomleika 大大講到這點真的是提醒了小弟 platform: win32 IDE: code::blocks svn 4820 compiler: MinGW-g++ 4.2.1 (mingw-g++-sjlj 4.2.1) (which is still be stated as a "technical preview", but so far so good.) code: int a[10]; int i = 0; void func(int, int); i = i + (i=1); a[i++] = i; i = i++; b = i + i++; func( i++, i ); warning: operation on 'i' may be undefined. warning: operation on 'i' may be undefined. warning: operation on 'i' may be undefined. warning: operation on 'i' may be undefined. warning: operation on 'i' may be undefined. 還在想考這種題目有沒有意義的朋友,夠了吧! compiler 都出來說話了! -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 203.72.57.78