xtest: remove __unused and do not include <compiler.h>
xtest (the 'host' part, not the TAs) uses __unused from OP-TEE's
<compiler.h>. This does not comply with the following statement from
the C specification:
In addition to the names documented in this manual, reserved names
include all external identifiers (global functions and variables)
that begin with an underscore (‘_’) and all identifiers regardless of
use that begin with either two underscores or an underscore followed
by a capital letter are reserved names. This is so that the library
and header files can define functions, variables, and macros for
internal purposes without risk of conflict with names in user
programs.
This is not a hypothetical problem, __unused is used by musl and as
such optee-test can't be built with musl.
<compiler.h> and __unused should only be used in TAs (in which case we
know the C library is OP-TEE's libutils). Remove them from xtest and add
-Wno-unused-param to the C flags instead.
Reported-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Jerome Forissier <jerome@forissier.org>
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
diff --git a/host/xtest/regression_8100.c b/host/xtest/regression_8100.c
index a1f8d0d..f349ca6 100644
--- a/host/xtest/regression_8100.c
+++ b/host/xtest/regression_8100.c
@@ -4,7 +4,6 @@
#include "xtest_test.h"
#include "xtest_helpers.h"
-#include <compiler.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
@@ -257,8 +256,8 @@
return ret;
}
#else /*!OPENSSL_FOUND*/
-static bool verify_cert(ADBG_Case_t *c __unused, const char *ca __unused,
- const char *mid __unused, const char *cert __unused)
+static bool verify_cert(ADBG_Case_t *c, const char *ca,
+ const char *mid, const char *cert)
{
Do_ADBG_Log("OpenSSL not available, skipping certificate verification");
return true;