其他分享
首页 > 其他分享> > C标准中未定义行为段落中的[注意]是什么意思?

C标准中未定义行为段落中的[注意]是什么意思?

作者:互联网

user Tony points out所述,C标准第1.3.12段中有[注]

permissible 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…

这与UB的定义是否相矛盾……这个国际标准没有要求吗?我的意思是他们说“没有要求”,然后说“允许的UB” – 就在同一段中.

该笔记应如何解释?它确实以任何方式限制UB吗?

解决方法:

根据ISO / IEC指令Part 3的§6.5.1:

Notes and examples integrated in the
text of a standard shall only be used
for giving additional information
intended to assist the understanding
or use of the standard and shall not
contain provisions to which it is
necessary to conform in order to be
able to claim compliance with the
standard.

因此,它完全是非规范性的(非约束性),仅用于可能的澄清.

标签:c,language-lawyer,undefined-behavior,standards,iso
来源: https://codeday.me/bug/20191003/1845880.html