Skip to content

Minor InputStream-class fixes#48

Open
vifactor wants to merge 3 commits intoCOVESA:masterfrom
vifactor:input-stream-fixes
Open

Minor InputStream-class fixes#48
vifactor wants to merge 3 commits intoCOVESA:masterfrom
vifactor:input-stream-fixes

Conversation

@vifactor
Copy link

@vifactor vifactor commented Aug 12, 2024

  • fix compiler warning for identical if-branches
In instantiation of 'bool CommonAPI::SomeIP::InputStream::_readBitValue(Type_&, uint8_t, bool) [with Type_ = unsigned char; uint8_t = unsigned char]':
[...]
CommonAPI/SomeIP/InputStream.hpp:633:17: warning: this condition has identical branches [-Wduplicated-branches]
  633 |                 if (isLittleEndian)
  • remove a related TODO statement by adding new class member
  • fix uninitialized variable

When InputStream::_readBitValue template is instantiated
with sizeof(Type_)==1 an if-statement had two identical brances.
itsSize variable at certain execution paths could remain
uninitializedi (i.e. contain garbage) before assignment to maxSize

additionally, this change decreases the scope of maxSize

Signed-off-by: Viktor Kopp <vifactor@gmail.com>
@vifactor
Copy link
Author

vifactor commented Nov 1, 2024

@fcmonteiro what would I need to do to have this considered? Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant