Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for MISRA C++ 2023 rule MISRACPP2023-8_2_5-a 'reinterpret_cast' should not be used #629

Closed
mohammedRafeeque opened this issue Jun 14, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@mohammedRafeeque
Copy link

Zserio version and language
Zserio: latest from master
Commit date: 6 days ago (6/4/2024 7:12:28 PM)
Commit hash: b8cc6c0

Describe the bug
2 Misra warnings are getting reported for rule MISRACPP2023-8_2_5-a

  1. if (!stream.write(reinterpret_cast<const char*>(buffer), static_caststd::streamsize(byteSize)))
  2. if (!stream.read(reinterpret_cast<char*>(bitBuffer.getBuffer()),
    static_caststd::streamsize(bitBuffer.getByteSize())))
<style> </style>
SNo Rule Severity Message Filename Linenumber
1255 MISRACPP2023-8_2_5-a 2 reinterpret_cast' should not be used zserio_runtime/zserio/FileUtil.cpp 49
1247 MISRACPP2023-8_2_5-a 2 'reinterpret_cast' should not be used zserio_runtime/zserio/FileUtil.cpp 19

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.

@mohammedRafeeque mohammedRafeeque added the bug Something isn't working label Jun 14, 2024
@mikir
Copy link
Contributor

mikir commented Jun 14, 2024

This is a duplicate to #586.

@Mi-La Mi-La closed this as completed Aug 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants