Skip to content

Conversation

@jirislaby
Copy link

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)
                   ^~~~~~~~~~~~~~~~~~~~~~~~

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)
                   ^~~~~~~~~~~~~~~~~~~~~~~~
@dorodnic dorodnic changed the base branch from master to development December 17, 2019 10:25
@dorodnic
Copy link
Contributor

Thanks @jirislaby
This is a good find

@dorodnic dorodnic merged commit 23ede77 into realsenseai:development Dec 29, 2019
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.

2 participants