Fixing compiler warnings

Adjusting toolchain files which compiler warnings to enable.

Fixing compiler warnings reported by Arm Clang and Arm GCC.

Change-Id: I715e875904ffd7ecfe994d3093cdf066373981b1
diff --git a/applications/freertos/main.cpp b/applications/freertos/main.cpp
index ae4bc38..0f4009e 100644
--- a/applications/freertos/main.cpp
+++ b/applications/freertos/main.cpp
@@ -164,7 +164,7 @@
     if (xPortIsInsideInterrupt()) {
         ret = xSemaphoreGiveFromISR(handle, NULL);
         if (ret != pdTRUE) {
-            printf("Error: Failed to give semaphore from ISR. ret - 0x%08x\n", ret);
+            printf("Error: Failed to give semaphore from ISR. ret - 0x%08lx\n", ret);
         }
     } else {
         ret = xSemaphoreGive(handle);
@@ -210,7 +210,7 @@
 void inferenceSenderTask(void *pvParameters) {
     int ret = 0;
 
-    QueueHandle_t inferenceProcessQueue = reinterpret_cast<QueueHandle_t>(pvParameters);
+    QueueHandle_t _inferenceProcessQueue = reinterpret_cast<QueueHandle_t>(pvParameters);
     xInferenceJob jobs[NUM_JOBS_PER_TASK];
 
     // Create queue for response messages
@@ -227,7 +227,7 @@
         job->responseQueue = senderQueue;
         // Send job
         printf("inferenceSenderTask: Sending inference job: job=%p, name=%s\n", job, job->name.c_str());
-        if (xQueueSend(inferenceProcessQueue, &job, portMAX_DELAY) != pdPASS) {
+        if (xQueueSend(_inferenceProcessQueue, &job, portMAX_DELAY) != pdPASS) {
             printf("Error: inferenceSenderTask failed in send to Q.\n");
             exit(1);
         }
diff --git a/applications/message_handler/main.cpp b/applications/message_handler/main.cpp
index 9f7c7cc..9b36f84 100644
--- a/applications/message_handler/main.cpp
+++ b/applications/message_handler/main.cpp
@@ -128,9 +128,11 @@
 
 namespace {
 
+#ifdef MHU_IRQ
 void mailboxIrqHandler() {
     mailbox.handleMessage();
 }
+#endif
 
 void inferenceTask(void *pvParameters) {
     printf("Starting inference task\n");
diff --git a/applications/message_handler/message_handler.cpp b/applications/message_handler/message_handler.cpp
index 7401546..f9f7304 100644
--- a/applications/message_handler/message_handler.cpp
+++ b/applications/message_handler/message_handler.cpp
@@ -375,7 +375,7 @@
 }
 
 void OutgoingMessageHandler::readCapabilties(ethosu_core_msg_capabilities_rsp &rsp) {
-    rsp = {0};
+    rsp = {};
 
 #ifdef ETHOSU
     struct ethosu_driver_version version;
diff --git a/applications/trustzone_inference/secure/main_secure.cpp b/applications/trustzone_inference/secure/main_secure.cpp
index df22929..984f19a 100644
--- a/applications/trustzone_inference/secure/main_secure.cpp
+++ b/applications/trustzone_inference/secure/main_secure.cpp
@@ -87,7 +87,7 @@
     const struct mpc_sie_dev_cfg_t mpc_dev_cfg = {SRAM0_MPC};
 
     /* MPC device data */
-    struct mpc_sie_dev_data_t mpc_dev_data = {0};
+    struct mpc_sie_dev_data_t mpc_dev_data = {};
 
     /* MPC device itself */
     struct mpc_sie_dev_t mpc_dev = {&mpc_dev_cfg, &mpc_dev_data};
@@ -154,7 +154,7 @@
     const struct mpc_sie_dev_cfg_t mpc_dev_cfg = {BRAM_MPC};
 
     /* MPC device data */
-    struct mpc_sie_dev_data_t mpc_dev_data = {0};
+    struct mpc_sie_dev_data_t mpc_dev_data = {};
 
     /* MPC device itself */
     struct mpc_sie_dev_t mpc_dev = {&mpc_dev_cfg, &mpc_dev_data};
diff --git a/cmake/toolchain/arm-none-eabi-gcc.cmake b/cmake/toolchain/arm-none-eabi-gcc.cmake
index 1605f24..d37a3dc 100644
--- a/cmake/toolchain/arm-none-eabi-gcc.cmake
+++ b/cmake/toolchain/arm-none-eabi-gcc.cmake
@@ -84,18 +84,17 @@
 add_compile_options(
     -Wall
     -Wextra
-    -Wsign-compare
-    -Wunused
-    -Wswitch-default
-    -Wformat
+
+    -Wcast-align
     -Wdouble-promotion
+    -Wformat
+    -Wmissing-field-initializers
+    -Wnull-dereference
     -Wredundant-decls
     -Wshadow
-    -Wcast-align
-    -Wnull-dereference
-    -Wno-format-extra-args
-    -Wno-unused-function
-    -Wno-unused-parameter
-    -Wno-unused-label
-    -Wno-missing-field-initializers
-    -Wno-return-type)
+    -Wswitch
+    -Wswitch-default
+    -Wunused
+
+    -Wno-redundant-decls
+)
\ No newline at end of file
diff --git a/cmake/toolchain/armclang.cmake b/cmake/toolchain/armclang.cmake
index 3217fbf..f65b9a5 100644
--- a/cmake/toolchain/armclang.cmake
+++ b/cmake/toolchain/armclang.cmake
@@ -73,18 +73,14 @@
 add_compile_options(
     -Wall
     -Wextra
-    -Wsign-compare
-    -Wunused
-    -Wswitch-default
-    -Wformat
+
+    -Wcast-align
     -Wdouble-promotion
+    -Wformat
+    -Wmissing-field-initializers
+    -Wnull-dereference
     -Wredundant-decls
     -Wshadow
-    -Wcast-align
-    -Wnull-dereference
-    -Wno-format-extra-args
-    -Wno-unused-function
-    -Wno-unused-parameter
-    -Wno-unused-label
-    -Wno-missing-field-initializers
-    -Wno-return-type)
+    -Wswitch-default
+    -Wunused
+)
diff --git a/targets/corstone-300/mpu.cpp b/targets/corstone-300/mpu.cpp
index 645723c..1d30ce0 100644
--- a/targets/corstone-300/mpu.cpp
+++ b/targets/corstone-300/mpu.cpp
@@ -39,7 +39,7 @@
 #ifdef ARM_MPU_ARMV8_H
     uint32_t mpuRegions = (MPU->TYPE & MPU_TYPE_DREGION_Msk) >> MPU_TYPE_DREGION_Pos;
 
-    printf("MPU available with " PRIu32 " regions.\n", mpuRegions);
+    printf("MPU available with %" PRIu32 " regions.\n", mpuRegions);
 
     printf("    PRIVDEFENA : %lx\n", (MPU->CTRL & MPU_CTRL_PRIVDEFENA_Msk) >> MPU_CTRL_PRIVDEFENA_Pos);
     printf("      HFNMIENA : %lx\n", (MPU->CTRL & MPU_CTRL_HFNMIENA_Msk) >> MPU_CTRL_HFNMIENA_Pos);
diff --git a/targets/corstone-300/target.cpp b/targets/corstone-300/target.cpp
index f979f85..88f98be 100644
--- a/targets/corstone-300/target.cpp
+++ b/targets/corstone-300/target.cpp
@@ -185,6 +185,7 @@
                                                                            ETHOSU_TA_PERFCTRL_0,
                                                                            ETHOSU_TA_PERFCNT_0,
                                                                            ETHOSU_TA_MODE_0,
+                                                                           0, // Read only register
                                                                            ETHOSU_TA_HISTBIN_0,
                                                                            ETHOSU_TA_HISTCNT_0},
                                                                           {ETHOSU_TA_MAXR_1,
@@ -198,8 +199,10 @@
                                                                            ETHOSU_TA_PERFCTRL_1,
                                                                            ETHOSU_TA_PERFCNT_1,
                                                                            ETHOSU_TA_MODE_1,
+                                                                           0, // Read only register
                                                                            ETHOSU_TA_HISTBIN_1,
                                                                            ETHOSU_TA_HISTCNT_1}};
+
 /****************************************************************************
  * Cache maintenance
  ****************************************************************************/