Skip to content

[BUG] warnings building Bluefruit52Lib's rssi_proximity_central example #382

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

Closed
henrygab opened this issue Nov 8, 2019 · 0 comments · Fixed by #385
Closed

[BUG] warnings building Bluefruit52Lib's rssi_proximity_central example #382

henrygab opened this issue Nov 8, 2019 · 0 comments · Fixed by #385
Labels

Comments

@henrygab
Copy link
Collaborator

henrygab commented Nov 8, 2019

Describe the bug
Sample code currently emits warnings.

.../Bluefruit52Lib/examples/Projects/rssi_proximity/rssi_proximity_central/rssi_proximity_central.ino:
    In function 'int invalidateRecords()':
.../Bluefruit52Lib/examples/Projects/rssi_proximity/rssi_proximity_central/rssi_proximity_central.ino:533:32:
    warning: comparison between signed and unsigned integer expressions [-Wsign-compare]

       if (records[i].timestamp <= millis() - TIMEOUT_MS)

Set up (please complete the following information)

To Reproduce
Steps to reproduce the behavior:

  1. Start a build based on PR 376
  2. Allow the build to complete
  3. Expand one of the three build jobs that enable additional warnings
  4. Review the build logs
    for the sample being fixed.

Expected behavior
Sample code should build without warnings.

@henrygab henrygab added the Bug label Nov 8, 2019
henrygab added a commit to henrygab/Adafruit_nRF52_Arduino that referenced this issue Nov 8, 2019
comparison between signed and unsigned integer expressions

Use uint32_t to store timestamp instead of int32_t.
Adjust comparison to use timestamp as a zero-basis.

This also avoids a bugs where a record that is added just before millis() overflows would never be removed from the list.
hathach added a commit that referenced this issue Nov 8, 2019
NaotoFujihiro pushed a commit to cami/ArduinoCore-nRF52 that referenced this issue Nov 13, 2019
comparison between signed and unsigned integer expressions

Use uint32_t to store timestamp instead of int32_t.
Adjust comparison to use timestamp as a zero-basis.

This also avoids a bugs where a record that is added just before millis() overflows would never be removed from the list.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant