[metadata]
id = "EXP15-C"
type = "recommendation"
category = "EXP"
number = 15
title = "Do not place a semicolon on the same line as an if, for, or while statement"
description = """
Do not use a semicolon on the same line as anif,for, orwhilestatement because it
typically indicates programmer error and can result in unexpected behavior. In
this noncompliant code example, a semicolon is used on the same line as
anifstatement: if (a == b); { /* ... */ }
"""
severity = "High"
likelihood = "Likely"
priority = "P27"
level = "L1"
cert_version = "2016 Edition (Wiki)"
last_modified = "May 20, 2025"
[rules.cert_c.EXP15-C]
enabled = true
[references]
wiki = "https://wiki.sei.cmu.edu/confluence/display/c/EXP15-C.+Do+not+place+a+semicolon+on+the+same+line+as+an+if%2C+for%2C+or+while+statement"
cwe = ["CWE-480"]