Use -Wall compiler warning level

Sets the C and C++ compiler warning level to -Wall. Fixes for
warnings judged to be non-functional are included in this commit.

Signed-off-by: Julian Hall <julian.hall@arm.com>
Change-Id: I783ff274b7fbd802bc25074953e2c2f287114605
diff --git a/environments/opteesp/default_toolchain_file.cmake b/environments/opteesp/default_toolchain_file.cmake
index 541cd89..3c4b9a6 100644
--- a/environments/opteesp/default_toolchain_file.cmake
+++ b/environments/opteesp/default_toolchain_file.cmake
@@ -1,5 +1,5 @@
 #-------------------------------------------------------------------------------
-# Copyright (c) 2020-2021, Arm Limited and Contributors. All rights reserved.
+# Copyright (c) 2020-2022, Arm Limited and Contributors. All rights reserved.
 #
 # SPDX-License-Identifier: BSD-3-Clause
 #
@@ -17,9 +17,16 @@
 
 include($ENV{TS_ROOT}/tools/cmake/compiler/GCC.cmake REQUIRED)
 include($ENV{TS_ROOT}/tools/cmake/compiler/config_iface.cmake REQUIRED)
+
 # Set mandatory compiler and linker flags for this environment:
 #   - Compile position independent code
 string(APPEND CMAKE_C_FLAGS_INIT " -fpic")
-#   - Disable startup files and default libraries.
+
+# Set compiler warning level for the root build context. External components
+# are responsible for setting their own warning level.
+if(DEFINED TS_ROOT)
+    string(APPEND CMAKE_C_FLAGS_INIT " -Wall")
+endif()
+
 #   - Link position independent executable
 string(APPEND CMAKE_EXE_LINKER_FLAGS_INIT " -pie")