erpc
erpc copied to clipboard
Asign value to ptrSize, to avoid maybe-uninitialized warning
Pull request
Choose Correct
- [X] bug
- [ ] feature
Describe the pull request
Using G++ compiler on windows, I was getting maybe-uninitialized warning on the if (ptrSize > sizeof(*value)). It is correct because read may not read in case that m_status is bad, although in this case the erpc behaviour is OK because also the updateStatus call will be ignored.
To Reproduce
Expected behavior
No compilation warning
Screenshots
Desktop (please complete the following information):
- OS: Windows
- eRPC Version:
Steps you didn't forgot to do
- [X] I checked if other PR isn't solving this issue.
- [X] I read Contribution details and did appropriate actions.
- [X] PR code is tested.
- [X] PR code is formatted.
- [X] Allow edits from maintainers pull request option is set (recommended).
Additional context
@Hadatko Can you check if the tests failure related to me?
BTW, other solution is to check if (isStatusOk() && ptrSize > sizeof(*value))
I created this issue related mac build; https://github.com/EmbeddedRPC/erpc/issues/408