common: fw-update-helper, don't compare addresses#5443
Merged
dorodnic merged 1 commit intorealsenseai:developmentfrom Dec 29, 2019
jirislaby:Waddress
Merged
common: fw-update-helper, don't compare addresses#5443dorodnic merged 1 commit intorealsenseai:developmentfrom jirislaby:Waddress
dorodnic merged 1 commit intorealsenseai:developmentfrom
jirislaby:Waddress
Conversation
create_default_fw_table tries to compare "" with another string. But
both are addresses. Use strlen in that case.
The compiler warns about it:
../common/fw-update-helper.cpp: In function 'std::map<int, std::vector<unsigned char> > rs2::create_default_fw_table()':
../common/fw-update-helper.cpp:21:34: warning: comparison with string literal results in unspecified behavior [-Waddress]
#define FW_D4XX_FW_IMAGE_VERSION ""
^
../common/fw-update-helper.cpp:71:19: note: in expansion of macro 'FW_D4XX_FW_IMAGE_VERSION'
if ("" != FW_D4XX_FW_IMAGE_VERSION && !allow_rc_firmware)
^~~~~~~~~~~~~~~~~~~~~~~~
Contributor
|
Thanks @jirislaby |
dorodnic
approved these changes
Dec 29, 2019
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
create_default_fw_tabletries to compare""with another string. Butboth are addresses. Use
strlenin that case.The compiler warns about it: