Fix -Werror related build issues
The release build triggers unused variable warnings due to asserts
being removed. Change affected code to remove the warnings.
For projects depending on the TF-A external component define the
TF-A specific ENABLE_ASSERTIONS=0 macro to avoid warnings in TF-A
source files.
Signed-off-by: Gabor Toth <gabor.toth2@arm.com>
Change-Id: Idf861bb1c7b1f90fc3a0d10aa59ea1e5943ea49a
diff --git a/components/common/uuid/uuid.c b/components/common/uuid/uuid.c
index 16b6730..85ac216 100644
--- a/components/common/uuid/uuid.c
+++ b/components/common/uuid/uuid.c
@@ -8,6 +8,7 @@
#include <assert.h>
#include <string.h>
#include <ctype.h>
+#include <compiler.h>
static uint8_t hex_to_nibble(char hex)
{
@@ -189,7 +190,7 @@
void uuid_octets_from_canonical(struct uuid_octets *uuid_octets,
const char *canonical_form)
{
- size_t valid_chars = uuid_parse_to_octets(canonical_form,
+ __maybe_unused size_t valid_chars = uuid_parse_to_octets(canonical_form,
uuid_octets->octets, sizeof(uuid_octets->octets));
/* Input string is assumed to be valid. Should not be used if canonical
@@ -201,7 +202,7 @@
void uuid_guid_octets_from_canonical(struct uuid_octets *uuid_octets,
const char *canonical_form)
{
- size_t valid_chars = uuid_parse_to_guid_octets(canonical_form,
+ __maybe_unused size_t valid_chars = uuid_parse_to_guid_octets(canonical_form,
uuid_octets->octets, sizeof(uuid_octets->octets));
assert(valid_chars == UUID_CANONICAL_FORM_LEN);