Enhancement: Adding -Wextra compiler option.
This enables some extra warning flags that are not
enabled by -Wall.
Signed-off-by: Vinay Kumar Kotegowder <vinaykumar.kotegowder@arm.com>
diff --git a/api-tests/tools/cmake/compiler/ARMCLANG.cmake b/api-tests/tools/cmake/compiler/ARMCLANG.cmake
index d96dc9d..119ab6c 100644
--- a/api-tests/tools/cmake/compiler/ARMCLANG.cmake
+++ b/api-tests/tools/cmake/compiler/ARMCLANG.cmake
@@ -58,6 +58,6 @@
set(TARGET_SWITCH "-march=armv8-m.base -mcmse")
endif()
-set(CMAKE_C_FLAGS "--target=arm-arm-none-eabi ${TARGET_SWITCH} -Wall -Werror -fshort-enums -fshort-wchar -funsigned-char -fdata-sections -ffunction-sections -mno-unaligned-access -mfpu=none")
+set(CMAKE_C_FLAGS "--target=arm-arm-none-eabi ${TARGET_SWITCH} -Wall -Werror -Wextra -fshort-enums -fshort-wchar -funsigned-char -fdata-sections -ffunction-sections -mno-unaligned-access -mfpu=none")
set(CMAKE_ASM_FLAGS "${TARGET_SWITCH} -mthumb")
set(CMAKE_EXE_LINKER_FLAGS "--strict --map --symbols --xref --info=summarysizes,sizes,totals,unused,veneers --diag_warning=L6204")
diff --git a/api-tests/tools/cmake/compiler/GNUARM.cmake b/api-tests/tools/cmake/compiler/GNUARM.cmake
index cede575..62a0b76 100644
--- a/api-tests/tools/cmake/compiler/GNUARM.cmake
+++ b/api-tests/tools/cmake/compiler/GNUARM.cmake
@@ -58,6 +58,6 @@
set(TARGET_SWITCH "-march=armv8-m.base -mcmse")
endif()
-set(CMAKE_C_FLAGS "${TARGET_SWITCH} -Wall -Werror -fdata-sections -ffunction-sections -mno-unaligned-access")
+set(CMAKE_C_FLAGS "${TARGET_SWITCH} -Wall -Werror -Wextra -fdata-sections -ffunction-sections -mno-unaligned-access")
set(CMAKE_ASM_FLAGS "${TARGET_SWITCH} -mthumb")
set(CMAKE_EXE_LINKER_FLAGS "-Xlinker --fatal-warnings -Xlinker --gc-sections -z max-page-size=0x400 -lgcc -lc -lnosys")
diff --git a/api-tests/tools/scripts/target_cfg/targetConfigGen.py b/api-tests/tools/scripts/target_cfg/targetConfigGen.py
index fd1f7e4..bfa8e30 100644
--- a/api-tests/tools/scripts/target_cfg/targetConfigGen.py
+++ b/api-tests/tools/scripts/target_cfg/targetConfigGen.py
@@ -123,7 +123,7 @@
o_f.write("\tfprintf(fp, \"#define _%s_H_\\n\");\n\n" %(temp_out_file[:temp_out_file.find('.')].upper()))
if section_name:
o_f.write("\tfprintf(fp, \"__attribute__((section(\\\"%s\\\")))\\n\");\n" %(section_name))
- o_f.write("\tfprintf(fp, \"const uint32_t static %s[] = {\\n\");\n" %(table_name))
+ o_f.write("\tfprintf(fp, \"static const uint32_t %s[] = {\\n\");\n" %(table_name))
o_f.write("\tfprintf(fp, \"0x%x\", \'T\');\n")
o_f.write("\tfprintf(fp, \"%x\", \'B\');\n")
o_f.write("\tfprintf(fp, \"%x\", \'S\');\n")