sqc 0.4.13

Software Code Quality - CERT C compliance checker
[metadata]
id = "EXP00-C"
type = "recommendation"
category = "EXP"
number = 0
title = "Use parentheses for precedence of operation"
description = """
C programmers commonly make errors regarding the precedence rules of C operators
because of the unintuitive low-precedence levels of&,|,^,<<, and>>. Mistakes
regarding precedence rules can be avoided by the suitable use of parentheses.
Using parentheses defensively reduces errors and, if not taken to excess, makes
the code more readable. Subclause 6.5 of the C Standard defines the precedence
of operation by the order of the subclauses. The intent of the expression in
this noncompliant code example is to test the least significant bit ofx:
"""
severity = "Low"
likelihood = "Probable"
priority = "P6"
level = "L2"
cert_version = "2016 Edition (Wiki)"
last_modified = "Aug 06, 2025"

[rules.cert_c.EXP00-C]
enabled = true

[references]
wiki = "https://wiki.sei.cmu.edu/confluence/display/c/EXP00-C.+Use+parentheses+for+precedence+of+operation"