MISRA中的注释规则的理由 [英] Rationale for comment rules in MISRA
本文介绍了MISRA中的注释规则的理由的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
MISRA中的规则2.2规定源代码只能使用 / * ... * /
样式注释。有谁知道这条规则的理由是什么? //
样式注释有什么问题?
解决方案
MISRA 1998 2004只支持C90标准(ANSI C)。在该标准中,不允许使用//注释,并且不能在C90编译器上编译包含它们的代码。
MISRA 2012支持C99标准和//注释。 >
Rule 2.2 in MISRA states that "source code shall only use /* ... */
style comments". Does any one know what is the rationale for this rule? what is wrong with //
style comments?
解决方案
MISRA 1998 and 2004 only support the C90 standard ("ANSI C"). In that standard, // comments are not allowed and code containing them will not compile on C90 compilers.
MISRA 2012 supports the C99 standard and // comments.
这篇关于MISRA中的注释规则的理由的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文