Reputation: 1923
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?
Upvotes: 8
Views: 6394
Reputation: 214187
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.
Upvotes: 10
Reputation: 2322
Further to Lundin's reply, MISRA-C:2012 (which covers C99) DOES allow // style comments
Upvotes: 4