[metadata]
id = "EXP32-C"
type = "rule"
category = "EXP"
number = 32
title = "Do not access a volatile object through a nonvolatile reference"
description = """
An object that has volatile-qualified type may be modified in ways unknown to
theimplementationor have other unknownside effects. Referencing a volatile
object by using a non-volatile lvalue isundefined behavior. The C Standard,
6.7.4 paragraph 7 [ISO/IEC 9899:2024], states Seeundefined behavior 62. In this
noncompliant code example, a volatile object is accessed through a non-volatile-
qualified reference, resulting inundefined behavior 62:
"""
severity = "Low"
likelihood = "Likely"
priority = "P6"
level = "L2"
cert_version = "2016 Edition (Wiki)"
last_modified = "Oct 29, 2025"
[rules.cert_c.EXP32-C]
enabled = true
[references]
wiki = "https://wiki.sei.cmu.edu/confluence/display/c/EXP32-C.+Do+not+access+a+volatile+object+through+a+nonvolatile+reference"