From: Ivan Grokhotkov Date: Tue, 19 Mar 2019 08:02:35 +0000 (+0800) Subject: Add -Wstrict-prototypes check in CI X-Git-Tag: v4.1-dev~31^2~6 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e8191912c8348464f173423502c17410f2ad4fb7;p=esp-idf Add -Wstrict-prototypes check in CI --- diff --git a/tools/ci/build_examples.sh b/tools/ci/build_examples.sh index c300452e75..7393cb3024 100755 --- a/tools/ci/build_examples.sh +++ b/tools/ci/build_examples.sh @@ -116,7 +116,7 @@ build_example () { pushd "example_builds/${ID}/${EXAMPLE_DIR_REL}" # be stricter in the CI build than the default IDF settings export EXTRA_CFLAGS=${PEDANTIC_CFLAGS} - export EXTRA_CXXFLAGS=${EXTRA_CFLAGS} + export EXTRA_CXXFLAGS=${PEDANTIC_CXXFLAGS} # sdkconfig files are normally not checked into git, but may be present when # a developer runs this script locally diff --git a/tools/ci/build_examples_cmake.sh b/tools/ci/build_examples_cmake.sh index 6ec906b0dc..da15bae725 100755 --- a/tools/ci/build_examples_cmake.sh +++ b/tools/ci/build_examples_cmake.sh @@ -111,7 +111,7 @@ build_example () { pushd "example_builds/${IDF_TARGET}/${ID}/${EXAMPLE_NAME}" # be stricter in the CI build than the default IDF settings export EXTRA_CFLAGS=${PEDANTIC_CFLAGS} - export EXTRA_CXXFLAGS=${EXTRA_CFLAGS} + export EXTRA_CXXFLAGS=${PEDANTIC_CXXFLAGS} # sdkconfig files are normally not checked into git, but may be present when # a developer runs this script locally diff --git a/tools/ci/config/build.yml b/tools/ci/config/build.yml index c5dab206d9..43bf408149 100644 --- a/tools/ci/config/build.yml +++ b/tools/ci/config/build.yml @@ -38,11 +38,13 @@ build_template_app: # Set the variable for 'esp-idf-template' testing - ESP_IDF_TEMPLATE_GIT=${ESP_IDF_TEMPLATE_GIT:-"https://github.com/espressif/esp-idf-template.git"} - git clone ${ESP_IDF_TEMPLATE_GIT} + # Try to use the same branch name for esp-idf-template that we're + # using on esp-idf. If it doesn't exist then just stick to the default branch - python $CHECKOUT_REF_SCRIPT esp-idf-template esp-idf-template - cd esp-idf-template - # Try to use the same branch name for esp-idf-template that we're - # using on esp-idf. If it doesn't exist then just stick to the default - # branch + - export PATH="$IDF_PATH/tools:$PATH" + - export EXTRA_CFLAGS=${PEDANTIC_CFLAGS} + - export EXTRA_CXXFLAGS=${PEDANTIC_CXXFLAGS} - make defconfig # Test debug build (default) - make all V=1 @@ -51,10 +53,17 @@ build_template_app: - sed -i.bak -e's/CONFIG_OPTIMIZATION_LEVEL_DEBUG\=y/CONFIG_OPTIMIZATION_LEVEL_RELEASE=y/' sdkconfig - make all V=1 # Check if there are any stray printf/ets_printf references in WiFi libs - - cd ../components/esp_wifi/lib_esp32 + - pushd ../components/esp_wifi/lib_esp32 - test $(xtensa-esp32-elf-nm *.a | grep -w printf | wc -l) -eq 0 - test $(xtensa-esp32-elf-nm *.a | grep -w ets_printf | wc -l) -eq 0 - + - popd + # Repeat the build using CMake + - rm -rf build sdkconfig + # Debug build + - idf.py build + # Release build + - sed -i.bak -e's/CONFIG_OPTIMIZATION_LEVEL_DEBUG\=y/CONFIG_OPTIMIZATION_LEVEL_RELEASE=y/' sdkconfig + - idf.py build build_ssc: extends: .build_template @@ -81,7 +90,7 @@ build_esp_idf_tests_make: extends: .build_esp_idf_unit_test_template script: - export EXTRA_CFLAGS=${PEDANTIC_CFLAGS} - - export EXTRA_CXXFLAGS=${EXTRA_CFLAGS} + - export EXTRA_CXXFLAGS=${PEDANTIC_CXXFLAGS} - cd $CI_PROJECT_DIR/tools/unit-test-app - MAKEFLAGS= make help # make sure kconfig tools are built in single process - make ut-clean-all-configs @@ -97,7 +106,7 @@ build_esp_idf_tests_cmake: script: - export PATH="$IDF_PATH/tools:$PATH" - export EXTRA_CFLAGS=${PEDANTIC_CFLAGS} - - export EXTRA_CXXFLAGS=${EXTRA_CFLAGS} + - export EXTRA_CXXFLAGS=${PEDANTIC_CXXFLAGS} - cd $CI_PROJECT_DIR/tools/unit-test-app - idf.py ut-clean-all-configs - idf.py ut-build-all-configs diff --git a/tools/ci/configure_ci_environment.sh b/tools/ci/configure_ci_environment.sh index 9a664c1ce9..d16e80500e 100644 --- a/tools/ci/configure_ci_environment.sh +++ b/tools/ci/configure_ci_environment.sh @@ -15,4 +15,7 @@ DEBUG_SHELL=${DEBUG_SHELL:-"0"} # Compiler flags to thoroughly check the IDF code in some CI jobs # (Depends on default options '-Wno-error=XXX' used in the IDF build system) -export PEDANTIC_CFLAGS="-DIDF_CI_BUILD -Werror -Werror=deprecated-declarations -Werror=unused-variable -Werror=unused-but-set-variable -Werror=unused-function" + +PEDANTIC_FLAGS="-DIDF_CI_BUILD -Werror -Werror=deprecated-declarations -Werror=unused-variable -Werror=unused-but-set-variable -Werror=unused-function" +export PEDANTIC_CFLAGS="${PEDANTIC_FLAGS} -Wstrict-prototypes" +export PEDANTIC_CXXFLAGS="${PEDANTIC_FLAGS}"