Skip to content

Clean up trivial gcc -wextra warnings #6254

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 8 commits into from
Jul 6, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@ git:
depth: 1
submodules: false

addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-7
- gcc-7

before_install:
- git submodule update --init # no recursive update

Expand Down Expand Up @@ -80,6 +88,7 @@ jobs:
stage: build
script: $TRAVIS_BUILD_DIR/tests/ci/host_test.sh
install: sudo apt-get install valgrind lcov
env: CC=gcc-7 CXX=g++-7

- name: "Docs"
stage: build
Expand All @@ -96,6 +105,7 @@ jobs:
- name: "Mock trivial test"
stage: build
script: $TRAVIS_BUILD_DIR/tests/buildm.sh
env: CC=gcc-7 CXX=g++-7

- name: "Boards"
stage: build
Expand Down
3 changes: 3 additions & 0 deletions cores/esp8266/libb64/cdecode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ static int base64_decode_block_signed(const int8_t* code_in, const int length_in
fragment = (int8_t)base64_decode_value_signed(*codechar++);
} while (fragment < 0);
*plainchar = (fragment & 0x03f) << 2;
// falls through
case step_b:
do {
if (codechar == code_in+length_in){
Expand All @@ -54,6 +55,7 @@ static int base64_decode_block_signed(const int8_t* code_in, const int length_in
} while (fragment < 0);
*plainchar++ |= (fragment & 0x030) >> 4;
*plainchar = (fragment & 0x00f) << 4;
// falls through
case step_c:
do {
if (codechar == code_in+length_in){
Expand All @@ -65,6 +67,7 @@ static int base64_decode_block_signed(const int8_t* code_in, const int length_in
} while (fragment < 0);
*plainchar++ |= (fragment & 0x03c) >> 2;
*plainchar = (fragment & 0x003) << 6;
// falls through
case step_d:
do {
if (codechar == code_in+length_in){
Expand Down
2 changes: 2 additions & 0 deletions cores/esp8266/libb64/cencode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ int base64_encode_block(const char* plaintext_in, int length_in, char* code_out,
result = (fragment & 0x0fc) >> 2;
*codechar++ = base64_encode_value(result);
result = (fragment & 0x003) << 4;
// falls through
case step_B:
if (plainchar == plaintextend){
state_in->result = result;
Expand All @@ -60,6 +61,7 @@ int base64_encode_block(const char* plaintext_in, int length_in, char* code_out,
result |= (fragment & 0x0f0) >> 4;
*codechar++ = base64_encode_value(result);
result = (fragment & 0x00f) << 2;
// falls through
case step_C:
if (plainchar == plaintextend){
state_in->result = result;
Expand Down
5 changes: 2 additions & 3 deletions libraries/ESP8266AVRISP/src/ESP8266AVRISP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,9 @@ AVRISPState_t ESP8266AVRISP::serve() {
case AVRISP_STATE_IDLE:
// should not be called when idle, error?
break;
case AVRISP_STATE_PENDING: {
case AVRISP_STATE_PENDING:
_state = AVRISP_STATE_ACTIVE;
// fallthrough
}
// falls through
case AVRISP_STATE_ACTIVE: {
while (_client.available()) {
avrisp();
Expand Down
2 changes: 1 addition & 1 deletion libraries/ESP8266SdFat
1 change: 1 addition & 0 deletions tests/host/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ FLAGS += -DLWIP_IPV6=0
FLAGS += -DHOST_MOCK=1
FLAGS += -DNONOSDK221=1
FLAGS += $(MKFLAGS)
FLAGS += -Wimplicit-fallthrough=2 # allow "// fall through" comments to stop spurious warnings
CXXFLAGS += -std=c++11 -fno-rtti $(FLAGS) -funsigned-char
CFLAGS += -std=c99 $(FLAGS) -funsigned-char
LDFLAGS += -coverage $(OPTZ) -g $(M32)
Expand Down
1 change: 1 addition & 0 deletions tests/host/common/UdpContextSocket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ size_t mockUDPFillInBuf (int sock, char* ccinbuf, size_t& ccinbufsize, uint8_t&
size_t mockUDPPeekBytes (int sock, char* dst, size_t usersize, int timeout_ms, char* ccinbuf, size_t& ccinbufsize)
{
(void) sock;
(void) timeout_ms;
if (usersize > CCBUFSIZE)
fprintf(stderr, MOCK "CCBUFSIZE(%d) should be increased by %zd bytes (-> %zd)\n", CCBUFSIZE, usersize - CCBUFSIZE, usersize);

Expand Down
3 changes: 3 additions & 0 deletions tests/host/common/include/ClientContext.h
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,9 @@ class ClientContext

void keepAlive (uint16_t idle_sec = TCP_DEFAULT_KEEPALIVE_IDLE_SEC, uint16_t intv_sec = TCP_DEFAULT_KEEPALIVE_INTERVAL_SEC, uint8_t count = TCP_DEFAULT_KEEPALIVE_COUNT)
{
(void) idle_sec;
(void) intv_sec;
(void) count;
mockverbose("TODO ClientContext::keepAlive()\n");
}

Expand Down