MISRA C:2012 Rule 11.10
The _Atomic qualifier shall not be applied to the incomplete type void
Since R2024b
Description
Rule Definition
The _Atomic
qualifier shall not be applied to the incomplete type
void.1
Rationale
The C standard does not guarantee that the _Atomic void*
type has any
specific size or alignment requirement. You cannot assume that the size and alignment of any
arbitrary type _Atomic T*
matches the size and alignment of the
_Atomic void*
type. Conversion between _Atomic void*
and _Atomic T*
can result in undefined behavior.
Polyspace Implementation
Polyspace® reports a violation of this rule if you use the _Atomic
qualifier on void
type objects.
Troubleshooting
If you expect a rule violation but do not see it, refer to Diagnose Why Coding Standard Violations Do Not Appear as Expected.
Examples
Check Information
Group: Pointer type conversions |
Category: Required |
AGC Category: Required |
Version History
Introduced in R2024b
1 All MISRA coding rules and directives are © Copyright The MISRA Consortium Limited 2021.
The MISRA coding standards referenced in the Polyspace Bug Finder™ documentation are from the following MISRA standards:
MISRA C:2004
MISRA C:2012
MISRA C:2023
MISRA C++:2008
MISRA C++:2023
MISRA and MISRA C are registered trademarks of The MISRA Consortium Limited 2021.