rspec/rules/S787/rule.adoc

30 lines
740 B
Plaintext
Raw Normal View History

== Why is this an issue?
2021-01-27 13:42:22 +01:00
This excludes the use of ``++//++`` C99 style comments and {cpp} style comments, since these are not permitted in C90. Many compilers support the ``++//++`` style of comments as an extension to C90. The use of ``++//++`` in preprocessor directives (e.g. ``++#define++``) can vary. Also the mixing of ``++/* ... */++`` and ``++//++`` is not consistent. This is more than a style issue, since different (pre C99) compilers may behave differently.
2020-06-30 12:50:59 +02:00
=== Noncompliant code example
2020-06-30 12:50:59 +02:00
2022-02-04 17:28:24 +01:00
[source,text]
2020-06-30 12:50:59 +02:00
----
int main(int argc, char* argv[])
{
// Do nothing - Noncompliant
return 0;
}
----
=== Compliant solution
2020-06-30 12:50:59 +02:00
2022-02-04 17:28:24 +01:00
[source,text]
2020-06-30 12:50:59 +02:00
----
int main(int argc, char* argv[])
{
/* Do nothing - Compliant */
return 0;
}
----