Fightwarn - pijuice#864
Merged
jimklimov merged 7 commits intonetworkupstools:masterfrom Nov 11, 2020
Merged
Conversation
error: ISO C does not support '__FUNCTION__' predefined identifier [-Werror=pedantic]
|
This pull request fixes 1 alert when merging 7ece017bd872475e92f1dffe0d0a03625aaa1af5 into 26c8994 - view on LGTM.com fixed alerts:
|
…hile fetching unsigned ints
Compiler warnings resolved this puzzle: [2020-11-09 15:10:38] [build-err] pijuice.c:737:2: note: in expansion of macro ‘I2C_WRITE_BYTE’ [2020-11-09 15:10:38] [build-err] 737 | I2C_WRITE_BYTE( upsfd, cmd, shutdown_delay, __func__ ) [2020-11-09 15:10:38] [build-err] | ^~~~~~~~~~~~~~ [2020-11-09 15:10:38] [build-err] pijuice.c:710:10: warning: variable ‘data’ set but not used [-Wunused-but-set-variable] [2020-11-09 15:10:38] [build-err] 710 | uint8_t data; [2020-11-09 15:10:38] [build-err] | ^~~~ So we did not need to set it at all, can go to simple anonymous negative-return check.
7ece017 to
08af693
Compare
|
This pull request fixes 1 alert when merging 08af693 into 26c8994 - view on LGTM.com fixed alerts:
|
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.
This PR follows up from recently merged #730 that added the PiJuice HAT driver, and #844 effort that hunts for warnings. It fixes several complaints about exceeded data type ranges and/or meaningless comparisons (is an
uint8_t < 0? is it> 255? neither can be, ever...)Another issue was about
__FUNCTION__being apparently a hack introduced by GCC, and only later a__func__was added into standards and superseded it.CC @aander07 for review (and possible similar bug-hunts in your other code).