Skip to content

Commit 90b4c6f

Browse files
Add errors on invalid/missing function return type (#8165)
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 #8160 Thanks to @hreintke and @mcspr for the tips.
1 parent d313673 commit 90b4c6f

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

Diff for: platform.txt

+5-5
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ runtime.tools.mkdir={runtime.platform.path}/tools/mkdir.py
2121
runtime.tools.cp={runtime.platform.path}/tools/cp.py
2222
runtime.tools.eboot={runtime.platform.path}/bootloaders/eboot/eboot.elf
2323

24-
compiler.warning_flags=-w
25-
compiler.warning_flags.none=-w
26-
compiler.warning_flags.default=
27-
compiler.warning_flags.more=-Wall
28-
compiler.warning_flags.all=-Wall -Wextra
24+
compiler.warning_flags=-w -Werror=return-type
25+
compiler.warning_flags.none=-w -Werror=return-type
26+
compiler.warning_flags.default=-Werror=return-type
27+
compiler.warning_flags.more=-Wall -Werror=return-type
28+
compiler.warning_flags.all=-Wall -Wextra -Werror=return-type
2929

3030
build.lwip_lib=-llwip_gcc
3131
build.lwip_include=lwip/include

Diff for: tools/platformio-build.py

+1
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ def scons_patched_match_splitext(path, suffixes=None):
6262
"-std=gnu17",
6363
"-Wpointer-arith",
6464
"-Wno-implicit-function-declaration",
65+
"-Werror=return-type",
6566
"-Wl,-EL",
6667
"-fno-inline-functions",
6768
"-nostdlib"

0 commit comments

Comments
 (0)