Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

In this noncompliant code example, a semicolon is used on the same line as an if statement.

Code Block
bgColor#FFcccc
if (a == b); {
  /* ... */
}

...

CERT C Secure Coding Standard

EXP15-C. Do not place a semicolon on the same line as an if, for, or while statement

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="8b8a02b6a2f519b3-2087e6dc-42da419a-bc7d825e-8f894635158672547e421b42"><ac:plain-text-body><![CDATA[

[ISO/IEC TR 24772:2010

http://www.aitcnet.org/isai/]

"Likely Incorrect Expression [java:KOA]"

]]></ac:plain-text-body></ac:structured-macro>

...

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="fafcf0a78b16bee4-bafe314f-40f54c91-94e09479-92c2e82fda36039134e72ff3"><ac:plain-text-body><![CDATA[

[java:Hatton 1995]

Section 2.7.2, "Errors of omission and addition"

]]></ac:plain-text-body></ac:structured-macro>

...