Rationale for comment rules in MISRA

心已入冬 提交于 2019-12-08 18:11:23

问题


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?


回答1:


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.




回答2:


Further to Lundin's reply, MISRA-C:2012 (which covers C99) DOES allow // style comments



来源:https://stackoverflow.com/questions/9538589/rationale-for-comment-rules-in-misra

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!