zserio
zserio copied to clipboard
Fix MISRA C++ 2023 rule 7.0.3 "The numerical value of a character shall not be used"
Zserio version and language Zserio: latest from master Commit date: 6 days ago (6/4/2024 7:12:28 PM) Commit hash: https://github.com/ndsev/zserio/commit/b8cc6c0df51cfa60740421c719f3dabfd88e0fb7
Describe the bug 2 Misra warnings are getting reported for rule MISRACPP2023-7_0_3-a
- for (char character : value)
- m_buffer.at(m_len) = 0;
| SNo | Rule | Severity | Message | Filename | Linenumber |
|---|---|---|---|---|---|
| 1298 | MISRACPP2023-7_0_3-a | 2 | The plain char type shall be initialized only by character values | /zserio_runtime/zserio/JsonEncoder.cpp | 55 |
| 1244 | MISRACPP2023-7_0_3-a | 2 | To the plain char type assign only character values | /zserio_runtime/zserio/CppRuntimeException.cpp | 42 |
Please check possibility of fixing the same.
Steps to reproduce the behavior: SCA run using MISRA 2023 configuration.
Expected behavior No SCA warnings for MISRA 2023 ruleset
Additional context N.A
@Roland-Homeier @mikir FYI.