diff --git a/.travis.yml b/.travis.yml index 498739f1cc..36bab4ecf1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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 @@ -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 @@ -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 diff --git a/cores/esp8266/libb64/cdecode.cpp b/cores/esp8266/libb64/cdecode.cpp index fcd6f0401a..47c5919dea 100755 --- a/cores/esp8266/libb64/cdecode.cpp +++ b/cores/esp8266/libb64/cdecode.cpp @@ -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){ @@ -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){ @@ -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){ diff --git a/cores/esp8266/libb64/cencode.cpp b/cores/esp8266/libb64/cencode.cpp index 69272faeca..ae8f90a831 100755 --- a/cores/esp8266/libb64/cencode.cpp +++ b/cores/esp8266/libb64/cencode.cpp @@ -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; @@ -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; diff --git a/libraries/ESP8266AVRISP/src/ESP8266AVRISP.cpp b/libraries/ESP8266AVRISP/src/ESP8266AVRISP.cpp index 187c917530..0c8aa8451d 100644 --- a/libraries/ESP8266AVRISP/src/ESP8266AVRISP.cpp +++ b/libraries/ESP8266AVRISP/src/ESP8266AVRISP.cpp @@ -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(); diff --git a/libraries/ESP8266SdFat b/libraries/ESP8266SdFat index 2499d4e0c6..6326c71ff1 160000 --- a/libraries/ESP8266SdFat +++ b/libraries/ESP8266SdFat @@ -1 +1 @@ -Subproject commit 2499d4e0c60db1a67a47532fc44c17d2d5116e4c +Subproject commit 6326c71ff1f6294756b6e348edaf723bfe7be3e7 diff --git a/tests/host/Makefile b/tests/host/Makefile index fd506d3574..6bd73ea61e 100644 --- a/tests/host/Makefile +++ b/tests/host/Makefile @@ -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) diff --git a/tests/host/common/UdpContextSocket.cpp b/tests/host/common/UdpContextSocket.cpp index 13c9b2d31c..347c760d80 100644 --- a/tests/host/common/UdpContextSocket.cpp +++ b/tests/host/common/UdpContextSocket.cpp @@ -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); diff --git a/tests/host/common/include/ClientContext.h b/tests/host/common/include/ClientContext.h index f9e4a9e3d5..31366ac0dd 100644 --- a/tests/host/common/include/ClientContext.h +++ b/tests/host/common/include/ClientContext.h @@ -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"); }