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 MISRA C++ 2023 rule 15.0.1 "Special member functions shall be provided appropriately" #637

Closed
mohammedRafeeque opened this issue Jun 14, 2024 · 1 comment
Assignees
Labels
bug Something isn't working c++ C++ language generator wontfix This will not be worked on
Milestone

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
1 Misra warning getting reported

  1. class CppRuntimeException : public std::exception
    
<style> </style>
SNo Rule Severity Message Filename Linenumber
1338 MISRACPP2023-15_0_1-a 2 Class 'CppRuntimeException' shall have a protected non-virtual destructor because it is not unmovable and used as a public base zserio_runtime/zserio/CppRuntimeException.h 20

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 mikir changed the title Fix MISRA C++ 2023 rule MISRACPP2023-15_0_1-a Class 'CppRuntimeException' shall have a protected non-virtual destructor because it is not unmovable and used as a public base Fix MISRA C++ 2023 rule 15.0.1 "Special member functions shall be provided appropriately" Jun 18, 2024
@mikir mikir added the c++ C++ language generator label Jun 18, 2024
@mikir mikir added this to the 2.15 milestone Jun 18, 2024
@Mi-La
Copy link
Contributor

Mi-La commented Aug 6, 2024

Since we inherit from std::exception, it's impossible to make the destructor protected non-virtual and it would be impossible to throw "unmovable" exception.

Also we didn't find an appropriate rule in Sonar - only similar rule which can make sense is: https://sonarcloud.io/organizations/ndsev/rules?open=cpp%3AS1235&rule_key=cpp%3AS1235 (and this rule is fulfilled).

@Mi-La Mi-La self-assigned this Aug 6, 2024
@Mi-La Mi-La added the wontfix This will not be worked on label Aug 6, 2024
@mikir mikir closed this as completed Aug 8, 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 c++ C++ language generator wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

3 participants