File tree 9 files changed +55
-13
lines changed 9 files changed +55
-13
lines changed Original file line number Diff line number Diff line change @@ -93,7 +93,7 @@ compiler.c.elf.cmd=xtensa-lx106-elf-gcc
93
93
compiler.c.elf.libs=-lhal -lphy -lpp -lnet80211 {build.lwip_lib} -lwpa -lcrypto -lmain -lwps -lbearssl -lespnow -lsmartconfig -lairkiss -lwpa2 {build.stdcpp_lib} -lm -lc -lgcc
94
94
95
95
compiler.cpp.cmd=xtensa-lx106-elf-g++
96
- compiler.cpp.flags=-c "{compiler.warning_flags}-cppflags " {build.stacksmash_flags} -g -free -fipa-pta -Werror=return-type -mlongcalls -mtext-section-literals -fno-rtti -falign-functions=4 {build.stdcpp_level} -MMD -ffunction-sections -fdata-sections {build.exception_flags} {build.sslflags} {build.mmuflags} {build.non32xferflags} {build.iramfloat}
96
+ compiler.cpp.flags=-c "{compiler.warning_flags}-cxxflags " {build.stacksmash_flags} -g -free -fipa-pta -Werror=return-type -mlongcalls -mtext-section-literals -fno-rtti -falign-functions=4 {build.stdcpp_level} -MMD -ffunction-sections -fdata-sections {build.exception_flags} {build.sslflags} {build.mmuflags} {build.non32xferflags} {build.iramfloat}
97
97
98
98
compiler.as.cmd=xtensa-lx106-elf-as
99
99
Original file line number Diff line number Diff line change @@ -131,6 +131,7 @@ function build_sketches()
131
131
local build_cmd
132
132
build_cmd+=${cli_path}
133
133
build_cmd+=" compile" \
134
+ " --warnings=all" \
134
135
" --build-path $build_dir " \
135
136
" --fqbn $fqbn " \
136
137
" --libraries $library_path " \
@@ -307,20 +308,23 @@ function install_core()
307
308
fi
308
309
309
310
# Set our custom warnings for all builds
310
- { echo " compiler.
10000
c.extra_flags=-Wall -Wextra -Werror $debug_flags " ;
311
- echo " compiler.cpp.extra_flags=-Wall -Wextra -Werror $debug_flags " ;
312
- echo " mkbuildoptglobals.extra_flags=--ci --cache_core" ; } \
313
- > platform.local.txt
311
+ printf " %s\n" \
312
+ " compiler.c.extra_flags=-Wall -Wextra $debug_flags " \
313
+ " compiler.cpp.extra_flags=-Wall -Wextra $debug_flags " \
314
+ " mkbuildoptglobals.extra_flags=--ci --cache_core" \
315
+ > ${core_path} /platform.local.txt
314
316
echo -e " \n----platform.local.txt----"
315
317
cat platform.local.txt
316
318
echo -e " \n----\n"
317
319
320
+ # Fetch toolchain & filesystem utils
318
321
pushd tools
319
322
python3 get.py -q
320
323
321
324
popd
322
325
popd
323
326
327
+ # todo: windows runners are using copied tree
324
328
local core_dir
325
329
core_dir=$( dirname " $hardware_core_path " )
326
330
mkdir -p " $core_dir "
Original file line number Diff line number Diff line change 1
1
These are the warning options for the compiler at different levels.
2
2
3
- Because G++ 10 produces code which crashes when a function is declared
3
+ Because GCC produces code which crashes when a function is declared
4
4
to return a value but doesn't (this is undefined per the C++ specs, but legal
5
5
for C11 and above code as long as the [ non] returned value is ignored), we
6
6
cannot warn them if we use "-w" to disable all warnings, and instead have
7
7
to delete every warning but "-Wreturn-type"
8
8
9
- Generate the "none-g++" file with the following command:
10
- ````
11
- ./tools/xtensa-lx106-elf/bin/xtensa-lx106-elf-gcc --help=warnings -Q | grep '\[enabled\]' | grep -v 'return-type' | awk '{print $1}' | sed 's/-W/-Wno-/' | grep -v = | grep -v -- -f | egrep -v '(c11-c2x-compat|c90-c99-compat|c99-c11-compat|declaration-after-statement|designated-init|discarded-array-qualifiers|discarded-qualifiers|implicit-int|incompatible-pointer-types|int-conversion|old-style-definition|override-init-side-effects|pointer-to-int-cast)' > tools/warnings/none-g++
12
- ````
9
+ Generate the C++ variant with the [ ` make_none-cxxflags.sh ` ] ( make_none-cxxflags.sh ) script
10
+
11
+ Modify [ ` patterns_none-cxxflags.txt ` ] ( patterns_none-cxxflags.txt ) patterns to ignore incompatible warning types
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env sh
2
+
3
+ root=$( git rev-parse --show-toplevel)
4
+ ${CC:- xtensa-lx106-elf-gcc} --help=warnings -Q | \
5
+ grep ' \[enabled\]' | \
6
+ grep -v ' return-type' | \
7
+ awk ' {print $1}' | \
8
+ sed ' s/-W/-Wno-/' | \
9
+ grep -v = | \
10
+ grep -v -f ${root} /tools/warnings/patterns_none-cxxflags.txt | \
11
+ sort -u > ${root} /tools/warnings/none-cxxflags
File renamed without changes.
Original file line number Diff line number Diff line change 1
1
-Wno-address-of-packed-member
2
2
-Wno-aggressive-loop-optimizations
3
+ -Wno-analyzer-double-fclose
4
+ -Wno-analyzer-double-free
5
+ -Wno-analyzer-exposure-through-output-file
6
+ -Wno-analyzer-file-leak
7
+ -Wno-analyzer-free-of-non-heap
3
8
-Wno-analyzer-malloc-leak
4
9
-Wno-analyzer-null-argument
5
10
-Wno-analyzer-null-dereference
8
13
-Wno-analyzer-stale-setjmp-buffer
9
14
-Wno-analyzer-tainted-array-index
10
15
-Wno-analyzer-unsafe-call-within-signal-handler
11
- -Wno-attribute-warning
16
+ -Wno-analyzer-use-after-free
17
+ -Wno-analyzer-use-of-pointer-in-stale-stack-frame
12
18
-Wno-attributes
19
+ -Wno-attribute-warning
13
20
-Wno-builtin-declaration-mismatch
14
21
-Wno-builtin-macro-redefined
15
22
-Wno-cannot-profile
16
23
-Wno-coverage-mismatch
17
24
-Wno-cpp
18
- -Wno-deprecated
19
- -Wno-deprecated-declarations
20
25
-Wno-div-by-zero
21
26
-Wno-endif-labels
22
27
-Wno-enum-compare
28
+ -Wno-free-nonheap-object
23
29
-Wno-hsa
24
30
-Wno-if-not-aligned
25
31
-Wno-ignored-attributes
Original file line number Diff line number Diff line change
1
+ =
2
+ NSObject-attribute
3
+ c11-c2x-compat
4
+ c90-c99-compat
5
+ c99-c11-compat
6
+ compare-distinct-pointer-types
7
+ complain-wrong-lang
8
+ declaration-after-statement
9
+ declaration-missing-parameter-type
10
+ deprecated
11
+ deprecated-declarations
12
+ designated-init
13
+ discarded-array-qualifiers
14
+ discarded-qualifiers
15
+ implicit-function-declaration
16
+ implicit-int
17
+ incompatible-pointer-types
18
+ int-conversion
19
+ old-style-definition
20
+ override-init-side-effects
21
+ pointer-to-int-cast
22
+ return-mismatch
You can’t perform that action at this time.
0 commit comments