-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Remove GCC -Wextra warnings from build process #6782
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
Merged
Merged
Conversation
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
When building the core with `-Wextra` a few locations have `case:` fall throughs or skipped field initializers. Add proper comments for B64 cases to avoid GCC warnings Initialized unused fields in Tone and WiFiGeneric to avoid missing field initializer warnings. ```` 2022-05-19T17:40:42.2280300Z /home/runner/arduino_ide/hardware/espressif/esp32/cores/esp32/libb64/cdecode.c: In function 'base64_decode_block_signed': 2022-05-19T17:40:42.2282122Z /home/runner/arduino_ide/hardware/espressif/esp32/cores/esp32/libb64/cdecode.c:42:23: warning: this statement may fall through [-Wimplicit-fallthrough=] 2022-05-19T17:40:42.2283247Z *plainchar = (fragment & 0x03f) << 2; 2022-05-19T17:40:42.2284240Z ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~ 2022-05-19T17:40:42.2285087Z /home/runner/arduino_ide/hardware/espressif/esp32/cores/esp32/libb64/cdecode.c:43:7: note: here 2022-05-19T17:40:42.2285435Z case step_b: 2022-05-19T17:40:42.2285691Z ^~~~ 2022-05-19T17:40:42.2286515Z /home/runner/arduino_ide/hardware/espressif/esp32/cores/esp32/libb64/cdecode.c:53:23: warning: this statement may fall through [-Wimplicit-fallthrough=] 2022-05-19T17:40:42.2286932Z *plainchar = (fragment & 0x00f) << 4; 2022-05-19T17:40:42.2287219Z ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~ 2022-05-19T17:40:42.2287609Z /home/runner/arduino_ide/hardware/espressif/esp32/cores/esp32/libb64/cdecode.c:54:7: note: here 2022-05-19T17:40:42.2287909Z case step_c: 2022-05-19T17:40:42.2288200Z ^~~~ 2022-05-19T17:40:42.2288972Z /home/runner/arduino_ide/hardware/espressif/esp32/cores/esp32/libb64/cdecode.c:64:23: warning: this statement may fall through [-Wimplicit-fallthrough=] 2022-05-19T17:40:42.2289491Z *plainchar = (fragment & 0x003) << 6; 2022-05-19T17:40:42.2289745Z ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~ 2022-05-19T17:40:42.2290162Z /home/runner/arduino_ide/hardware/espressif/esp32/cores/esp32/libb64/cdecode.c:65:7: note: here 2022-05-19T17:40:42.2290509Z case step_d: 2022-05-19T17:40:42.2290714Z ^~~~ 2022-05-19T17:40:42.2482744Z /home/runner/arduino_ide/hardware/espressif/esp32/cores/esp32/libb64/cencode.c: In function 'base64_encode_block': 2022-05-19T17:40:42.2484713Z /home/runner/arduino_ide/hardware/espressif/esp32/cores/esp32/libb64/cencode.c:46:20: warning: this statement may fall through [-Wimplicit-fallthrough=] 2022-05-19T17:40:42.2485415Z result = (fragment & 0x003) << 4; 2022-05-19T17:40:42.2486713Z ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~ 2022-05-19T17:40:42.2487696Z /home/runner/arduino_ide/hardware/espressif/esp32/cores/esp32/libb64/cencode.c:47:9: note: here 2022-05-19T17:40:42.2488519Z case step_B: 2022-05-19T17:40:42.2489175Z ^~~~ 2022-05-19T17:40:42.2492458Z /home/runner/arduino_ide/hardware/espressif/esp32/cores/esp32/libb64/cencode.c:56:20: warning: this statement may fall through [-Wimplicit-fallthrough=] 2022-05-19T17:40:42.2493351Z result = (fragment & 0x00f) << 2; 2022-05-19T17:40:42.2494227Z ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~ 2022-05-19T17:40:42.2496324Z /home/runner/arduino_ide/hardware/espressif/esp32/cores/esp32/libb64/cencode.c:57:9: note: here 2022-05-19T17:40:42.2496937Z case step_C: 2022-05-19T17:40:42.2497261Z ^~~~ 2022-05-19T17:40:44.6354962Z /home/runner/arduino_ide/hardware/espressif/esp32/cores/esp32/Tone.cpp: In function 'void setToneChannel(uint8_t)': 2022-05-19T17:40:44.6356417Z /home/runner/arduino_ide/hardware/espressif/esp32/cores/esp32/Tone.cpp:99:5: warning: missing initializer for member 'tone_msg_t::pin' [-Wmissing-field-initializers] 2022-05-19T17:40:44.6357120Z }; 2022-05-19T17:40:44.6358732Z ^ 2022-05-19T17:40:44.6364470Z /home/runner/arduino_ide/hardware/espressif/esp32/cores/esp32/Tone.cpp:99:5: warning: missing initializer for member 'tone_msg_t::frequency' [-Wmissing-field-initializers] 2022-05-19T17:40:44.6367914Z /home/runner/arduino_ide/hardware/espressif/esp32/cores/esp32/Tone.cpp:99:5: warning: missing initializer for member 'tone_msg_t::duration' [-Wmissing-field-initializers] 2022-05-19T17:40:44.6372875Z /home/runner/arduino_ide/hardware/espressif/esp32/cores/esp32/Tone.cpp: In function 'void noTone(uint8_t)': 2022-05-19T17:40:44.6373943Z /home/runner/arduino_ide/hardware/espressif/esp32/cores/esp32/Tone.cpp:110:5: warning: missing initializer for member 'tone_msg_t::frequency' [-Wmissing-field-initializers] 2022-05-19T17:40:44.6375154Z }; 2022-05-19T17:40:44.6375825Z ^ 2022-05-19T17:40:44.6379852Z /home/runner/arduino_ide/hardware/espressif/esp32/cores/esp32/Tone.cpp:110:5: warning: missing initializer for member 'tone_msg_t::duration' [-Wmissing-field-initializers] 2022-05-19T17:40:44.6383291Z /home/runner/arduino_ide/hardware/espressif/esp32/cores/esp32/Tone.cpp:110:5: warning: missing initializer for member 'tone_msg_t::channel' [-Wmissing-field-initializers] 2022-05-19T17:40:44.6388688Z /home/runner/arduino_ide/hardware/espressif/esp32/cores/esp32/Tone.cpp: In function 'void tone(uint8_t, unsigned int, long unsigned int)': 2022-05-19T17:40:44.6389829Z /home/runner/arduino_ide/hardware/espressif/esp32/cores/esp32/Tone.cpp:128:5: warning: missing initializer for member 'tone_msg_t::channel' [-Wmissing-field-initializers] 2022-05-19T17:40:44.6390677Z }; 2022-05-19T17:40:44.6391420Z ^ 2022-05-19T17:42:00.6768353Z /home/runner/arduino_ide/hardware/espressif/esp32/libraries/WiFi/src/WiFiGeneric.cpp: In static member function 'static bool WiFiGenericClass::setDualAntennaConfig(uint8_t, uint8_t, wifi_rx_ant_t, wifi_tx_ant_t)': 2022-05-19T17:42:00.6769293Z /home/runner/arduino_ide/hardware/espressif/esp32/libraries/WiFi/src/WiFiGeneric.cpp:1333:5: warning: missing initializer for member 'wifi_ant_config_t::rx_ant_default' [-Wmissing-field-initializers] 2022-05-19T17:42:00.6769658Z }; 2022-05-19T17:42:00.6769824Z ^ ````
This would also allow enabling |
Thanks @earlephilhower :) |
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.
Description of Change
When building the core with
-Wextra
a few locations havecase:
fall throughs or skipped field initializers.
Add proper comments for B64 cases to avoid GCC warnings
Initialized unused fields in Tone and WiFiGeneric to avoid missing
field initializer warnings.
Tests scenarios
Builds from the IDE with
File->Preferences->Compiler Warnings->All
show warnings shown belowAfter applying this patch they disappear.