- 论坛徽章:
- 0
|
本帖最后由 hbmhalley 于 2012-06-23 12:33 编辑
kzl0629 发表于 2012-06-23 11:52 ![]()
回复 512# hbmhalley
我说的你看不懂???
我没说diagnostic message 可以报编译错误,
文章中说给出diagnostic message ,但是没说只给出diagnostic message,明白这句话的意思???你别指抱着一个diagnostic message ,编译器不止产生一个diagnostic message
至于问题2,我之前说过了,这个是由语法错误产生的diagnostic ,语法错误产生的diagnostic 可以报编译出错,其他行为产生的diagnostic 就不许报了??? 是这样吗,回答是还是否???
说你语文是个渣还屈你了??
终于tm扯到正题了。
不是!
不仅语法错误,标准给了编译器遇到undefined behavior时terminate translation的权利。
[qoute]
3.4.3
1 undefined behavior
behavior, upon use of a nonportable or erroneous program construct or of erroneous data, for which this International Standard imposes no requirements
2 NOTE Possible undefined behavior ranges from ignoring the situation completely with unpredictable results, to behaving during translation or program execution in a documented manner characteristic of the environment (with or without the issuance of a diagnostic message), to terminating a translation or execution (with the issuance of a diagnostic message).
3 EXAMPLE
An example of undefined behavior is the behavior on integer overflow.
[/quote]
再没有别的了 //add:也许有,但绝不在implementation-defined behavior里面
如果你忽略UB,那么:是!
难道你想说否?
然后呢?
|
|