20-11-2025, 12:46 PM
The amplification of Rule 21.18 states that the size parameter shall be no greater than the size of the smallest object passed to the function through a pointer parameter.
In your example, the smallest object is six characters - therefore passing a size of 128 is non-compliant with the Rule.
In your example, the smallest object is six characters - therefore passing a size of 128 is non-compliant with the Rule.
Posted by and on behalf of the MISRA C Working Group

