From 974e3be945aea2d0c954b5a653e26921cf925ddb Mon Sep 17 00:00:00 2001 From: "Earle F. Philhower, III" Date: Wed, 23 Jun 2021 09:03:57 -0700 Subject: [PATCH 1/2] Add errors on invalid/missing function return type GCC 10.x seems to have a knack for crashing when a function which is declared to return a value does not. Add a warning, present on all builds, when this is the case. For more info see https://github.com/esp8266/Arduino/discussions/8160 Thanks to @hreintke for the tip --- platform.txt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/platform.txt b/platform.txt index 88d9c82b5a..cabfb151f1 100644 --- a/platform.txt +++ b/platform.txt @@ -21,11 +21,11 @@ runtime.tools.mkdir={runtime.platform.path}/tools/mkdir.py runtime.tools.cp={runtime.platform.path}/tools/cp.py runtime.tools.eboot={runtime.platform.path}/bootloaders/eboot/eboot.elf -compiler.warning_flags=-w -compiler.warning_flags.none=-w -compiler.warning_flags.default= -compiler.warning_flags.more=-Wall -compiler.warning_flags.all=-Wall -Wextra +compiler.warning_flags=-w -Werror=return-type +compiler.warning_flags.none=-w -Werror=return-type +compiler.warning_flags.default=-Werror=return-type +compiler.warning_flags.more=-Wall -Werror=return-type +compiler.warning_flags.all=-Wall -Wextra -Werror=return-type build.lwip_lib=-llwip_gcc build.lwip_include=lwip/include From c0bfbf03a7ac5f8408395a7efa6c174350bc347c Mon Sep 17 00:00:00 2001 From: "Earle F. Philhower, III" Date: Thu, 24 Jun 2021 07:05:37 -0700 Subject: [PATCH 2/2] Add PlatformIO warning, as well Thanks @mcspr! --- tools/platformio-build.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/platformio-build.py b/tools/platformio-build.py index 35a88fe446..de0c019e2b 100644 --- a/tools/platformio-build.py +++ b/tools/platformio-build.py @@ -62,6 +62,7 @@ def scons_patched_match_splitext(path, suffixes=None): "-std=gnu17", "-Wpointer-arith", "-Wno-implicit-function-declaration", + "-Werror=return-type", "-Wl,-EL", "-fno-inline-functions", "-nostdlib"