sqc 0.4.13

Software Code Quality - CERT C compliance checker
[metadata]
id = "EXP20-C"
type = "recommendation"
category = "EXP"
number = 20
title = "Perform explicit tests to determine success, true and false, and equality"
description = """
Perform explicit tests to determine success, true/false, and equality to improve
the readability and maintainability of code and for compatibility with common
conventions. In particular, do not default the test for nonzero. For instance,
suppose afoo()function returns 0 to indicate failure or a nonzero value to
indicate success. Testing for inequality with 0, if (foo() != 0) ...
"""
severity = "Medium"
likelihood = "Probable"
priority = "P12"
level = "L1"
cert_version = "2016 Edition (Wiki)"
last_modified = "Oct 29, 2025"

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

[references]
wiki = "https://wiki.sei.cmu.edu/confluence/display/c/EXP20-C.+Perform+explicit+tests+to+determine+success%2C+true+and+false%2C+and+equality"