ghs: replace the "-Wall" build option with the "-ghstd=last"

According to the Greenhills documentation, the "-Wall" option is
deprecated for use. Instead, the "-ghstd=last" option is recommended.
Compared with "-Wall", the "-ghstd=last" option can capture more
warnings and has stricter rules.

Signed-off-by: guoshichao <guoshichao@xiaomi.com>
This commit is contained in:
guoshichao
2024-11-18 19:38:15 +08:00
committed by Xiang Xiao
parent ba8abb5643
commit 49a57ddfbc
2 changed files with 9 additions and 2 deletions
+1 -1
View File
@@ -60,7 +60,7 @@ endif()
# Architecture flags
add_link_options(-entry=__start)
add_compile_options(--no_commons -Wall -Wshadow -Wundef -nostdlib)
add_compile_options(--no_commons --ghstd=last -Wshadow -Wundef -nostdlib)
add_compile_options(--option=305)
if(CONFIG_DEBUG_CUSTOMOPT)
+8 -1
View File
@@ -410,7 +410,14 @@ ARCHOPTIMIZATION += --no_commons
else
ARCHOPTIMIZATION += -fno-common
endif
ARCHOPTIMIZATION += -Wall -Wshadow -Wundef
ifeq ($(CONFIG_ARM_TOOLCHAIN_GHS),y)
ARCHOPTIMIZATION += --ghstd=last
else
ARCHOPTIMIZATION += -Wall
endif
ARCHOPTIMIZATION += -Wshadow -Wundef
ifeq ($(CONFIG_ARM_TOOLCHAIN_ARMCLANG),y)
ARCHOPTIMIZATION += -nostdlib