mirror of
https://github.com/ARM-software/arm-trusted-firmware.git
synced 2025-04-23 13:36:05 +00:00
Merge pull request #1708 from Yann-lms/warnings
Add possibility to add compilation warnings
This commit is contained in:
commit
c0940083bc
10 changed files with 56 additions and 7 deletions
44
Makefile
44
Makefile
|
@ -188,8 +188,50 @@ TF_CFLAGS_aarch64 += -mgeneral-regs-only -mstrict-align
|
||||||
ASFLAGS_aarch32 = $(march32-directive)
|
ASFLAGS_aarch32 = $(march32-directive)
|
||||||
ASFLAGS_aarch64 = -march=armv8-a
|
ASFLAGS_aarch64 = -march=armv8-a
|
||||||
|
|
||||||
|
WARNING1 := -Wextra
|
||||||
|
WARNING1 += -Wunused -Wno-unused-parameter
|
||||||
|
WARNING1 += -Wmissing-declarations
|
||||||
|
WARNING1 += -Wmissing-format-attribute
|
||||||
|
WARNING1 += -Wmissing-prototypes
|
||||||
|
WARNING1 += -Wold-style-definition
|
||||||
|
WARNING1 += -Wunused-but-set-variable
|
||||||
|
WARNING1 += -Wunused-const-variable
|
||||||
|
|
||||||
|
WARNING2 := -Waggregate-return
|
||||||
|
WARNING2 += -Wcast-align
|
||||||
|
WARNING2 += -Wdisabled-optimization
|
||||||
|
WARNING2 += -Wnested-externs
|
||||||
|
WARNING2 += -Wshadow
|
||||||
|
WARNING2 += -Wlogical-op
|
||||||
|
WARNING2 += -Wmissing-field-initializers
|
||||||
|
WARNING2 += -Wsign-compare
|
||||||
|
WARNING2 += -Wmaybe-uninitialized
|
||||||
|
|
||||||
|
WARNING3 := -Wbad-function-cast
|
||||||
|
WARNING3 += -Wcast-qual
|
||||||
|
WARNING3 += -Wconversion
|
||||||
|
WARNING3 += -Wpacked
|
||||||
|
WARNING3 += -Wpadded
|
||||||
|
WARNING3 += -Wpointer-arith
|
||||||
|
WARNING3 += -Wredundant-decls
|
||||||
|
WARNING3 += -Wswitch-default
|
||||||
|
WARNING3 += -Wpacked-bitfield-compat
|
||||||
|
WARNING3 += -Wvla
|
||||||
|
|
||||||
|
ifeq (${W},1)
|
||||||
|
WARNINGS := $(WARNING1)
|
||||||
|
else ifeq (${W},2)
|
||||||
|
WARNINGS := $(WARNING1) $(WARNING2)
|
||||||
|
else ifeq (${W},3)
|
||||||
|
WARNINGS := $(WARNING1) $(WARNING2) $(WARNING3)
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifneq (${E},0)
|
||||||
|
ERRORS := -Werror
|
||||||
|
endif
|
||||||
|
|
||||||
CPPFLAGS = ${DEFINES} ${INCLUDES} ${MBEDTLS_INC} -nostdinc \
|
CPPFLAGS = ${DEFINES} ${INCLUDES} ${MBEDTLS_INC} -nostdinc \
|
||||||
-Wmissing-include-dirs -Werror
|
-Wmissing-include-dirs $(ERRORS) $(WARNINGS)
|
||||||
ASFLAGS += $(CPPFLAGS) $(ASFLAGS_$(ARCH)) \
|
ASFLAGS += $(CPPFLAGS) $(ASFLAGS_$(ARCH)) \
|
||||||
-D__ASSEMBLY__ -ffreestanding \
|
-D__ASSEMBLY__ -ffreestanding \
|
||||||
-Wa,--fatal-warnings
|
-Wa,--fatal-warnings
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
* SPDX-License-Identifier: BSD-3-Clause
|
* SPDX-License-Identifier: BSD-3-Clause
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "../bl2_private.h"
|
||||||
|
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Place holder function to perform any Secure SVC specific architectural
|
* Place holder function to perform any Secure SVC specific architectural
|
||||||
|
|
|
@ -8,6 +8,9 @@
|
||||||
#define BL2_PRIVATE_H
|
#define BL2_PRIVATE_H
|
||||||
|
|
||||||
#if BL2_IN_XIP_MEM
|
#if BL2_IN_XIP_MEM
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Declarations of linker defined symbols which will tell us where BL2 lives
|
* Declarations of linker defined symbols which will tell us where BL2 lives
|
||||||
* in Trusted ROM and RAM
|
* in Trusted ROM and RAM
|
||||||
|
|
|
@ -67,8 +67,10 @@ io_type_t device_type_block(void)
|
||||||
static int find_first_block_state(const io_block_dev_spec_t *dev_spec,
|
static int find_first_block_state(const io_block_dev_spec_t *dev_spec,
|
||||||
unsigned int *index_out)
|
unsigned int *index_out)
|
||||||
{
|
{
|
||||||
|
unsigned int index;
|
||||||
int result = -ENOENT;
|
int result = -ENOENT;
|
||||||
for (int index = 0; index < MAX_IO_BLOCK_DEVICES; ++index) {
|
|
||||||
|
for (index = 0U; index < MAX_IO_BLOCK_DEVICES; ++index) {
|
||||||
/* dev_spec is used as identifier since it's unique */
|
/* dev_spec is used as identifier since it's unique */
|
||||||
if (state_pool[index].dev_spec == dev_spec) {
|
if (state_pool[index].dev_spec == dev_spec) {
|
||||||
result = 0;
|
result = 0;
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <debug.h>
|
#include <debug.h>
|
||||||
|
#include <platform.h>
|
||||||
|
|
||||||
/* Allow platforms to override the log prefix string */
|
/* Allow platforms to override the log prefix string */
|
||||||
#pragma weak plat_log_get_prefix
|
#pragma weak plat_log_get_prefix
|
||||||
|
|
|
@ -41,7 +41,7 @@
|
||||||
#define MAX_IO_DEVICES 3
|
#define MAX_IO_DEVICES 3
|
||||||
#define MAX_IO_HANDLES 4
|
#define MAX_IO_HANDLES 4
|
||||||
/* eMMC RPMB and eMMC User Data */
|
/* eMMC RPMB and eMMC User Data */
|
||||||
#define MAX_IO_BLOCK_DEVICES 2
|
#define MAX_IO_BLOCK_DEVICES U(2)
|
||||||
|
|
||||||
/* GIC related constants (no GICR in GIC-400) */
|
/* GIC related constants (no GICR in GIC-400) */
|
||||||
#define PLAT_ARM_GICD_BASE 0xF6801000
|
#define PLAT_ARM_GICD_BASE 0xF6801000
|
||||||
|
|
|
@ -38,7 +38,7 @@
|
||||||
#define MAX_IO_DEVICES 3
|
#define MAX_IO_DEVICES 3
|
||||||
#define MAX_IO_HANDLES 4
|
#define MAX_IO_HANDLES 4
|
||||||
/* UFS RPMB and UFS User Data */
|
/* UFS RPMB and UFS User Data */
|
||||||
#define MAX_IO_BLOCK_DEVICES 2
|
#define MAX_IO_BLOCK_DEVICES U(2)
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -40,7 +40,7 @@
|
||||||
/* IO framework user */
|
/* IO framework user */
|
||||||
#define MAX_IO_DEVICES (4)
|
#define MAX_IO_DEVICES (4)
|
||||||
#define MAX_IO_HANDLES (4)
|
#define MAX_IO_HANDLES (4)
|
||||||
#define MAX_IO_BLOCK_DEVICES (2)
|
#define MAX_IO_BLOCK_DEVICES U(2)
|
||||||
|
|
||||||
/* Memory size options */
|
/* Memory size options */
|
||||||
#define POPLAR_DRAM_SIZE_1G 0
|
#define POPLAR_DRAM_SIZE_1G 0
|
||||||
|
|
|
@ -169,7 +169,7 @@
|
||||||
#define MAX_XLAT_TABLES 6
|
#define MAX_XLAT_TABLES 6
|
||||||
#define MAX_IO_DEVICES 2
|
#define MAX_IO_DEVICES 2
|
||||||
#define MAX_IO_HANDLES 3
|
#define MAX_IO_HANDLES 3
|
||||||
#define MAX_IO_BLOCK_DEVICES 1
|
#define MAX_IO_BLOCK_DEVICES 1U
|
||||||
|
|
||||||
/* UART defines */
|
/* UART defines */
|
||||||
#if PLAT_WARP7_UART == 1
|
#if PLAT_WARP7_UART == 1
|
||||||
|
|
|
@ -53,7 +53,7 @@
|
||||||
|
|
||||||
#define MAX_IO_HANDLES 2
|
#define MAX_IO_HANDLES 2
|
||||||
#define MAX_IO_DEVICES 2
|
#define MAX_IO_DEVICES 2
|
||||||
#define MAX_IO_BLOCK_DEVICES 1
|
#define MAX_IO_BLOCK_DEVICES U(1)
|
||||||
|
|
||||||
#define TSP_SEC_MEM_BASE (BL32_BASE)
|
#define TSP_SEC_MEM_BASE (BL32_BASE)
|
||||||
#define TSP_SEC_MEM_SIZE ((BL32_LIMIT) - (BL32_BASE))
|
#define TSP_SEC_MEM_SIZE ((BL32_LIMIT) - (BL32_BASE))
|
||||||
|
|
Loading…
Add table
Reference in a new issue