blob: 1210ec14e9789a462c4edc9dfb58652bff500bbb [file] [log] [blame]
Gabor Toth96c110a2025-04-30 11:44:00 +02001From 980025011cb99dbbfc5812d7ca01fa6efaf2d368 Mon Sep 17 00:00:00 2001
2From: Gabor Toth <gabor.toth@arm.com>
3Date: Thu, 17 Apr 2025 16:22:19 +0200
4Subject: [PATCH] build: Add fix for GCC null-dereference check
5
6Turn off GCC null-dereference check on specific test code, which
7should not be executed anyway.
8
9Signed-off-by: Gabor Toth <gabor.toth@arm.com>
10Change-Id: Icf4d90ad92a63ffe170c43e8ff065e7ffb940008
11---
12 api-tests/ff/ipc/test_i047/test_supp_i047.c | 14 +++++++++++++-
13 1 file changed, 13 insertions(+), 1 deletion(-)
14
15diff --git a/api-tests/ff/ipc/test_i047/test_supp_i047.c b/api-tests/ff/ipc/test_i047/test_supp_i047.c
16index efa3a3f..899442c 100644
17--- a/api-tests/ff/ipc/test_i047/test_supp_i047.c
18+++ b/api-tests/ff/ipc/test_i047/test_supp_i047.c
19@@ -1,5 +1,5 @@
20 /** @file
21- * Copyright (c) 2019-2024, Arm Limited or its affiliates. All rights reserved.
22+ * Copyright (c) 2019-2025, Arm Limited or its affiliates. All rights reserved.
23 * SPDX-License-Identifier : Apache-2.0
24 *
25 * Licensed under the Apache License, Version 2.0 (the "License");
26@@ -206,9 +206,21 @@ int32_t server_test_psa_get_with_invalid_msg_pointer(void)
27 val->print(PRINT_ERROR, "\tFailed to set boot flag after check\n", 0);
28 }
29
30+ /* GCC null-dereference check fails because of invalid_msg, however this
31+ * part should not be reached according the comment above.
32+ */
33+ #if defined(__GNUC__)
34+ #pragma GCC diagnostic push
35+ #pragma GCC diagnostic ignored "-Wnull-dereference"
36+ #endif
37+
38 /* Reject the connection */
39 psa->reply(invalid_msg->handle, PSA_ERROR_CONNECTION_REFUSED);
40
41+ #if defined(__GNUC__)
42+ #pragma GCC diagnostic pop
43+ #endif
44+
45 return VAL_STATUS_SPM_FAILED;
46 }
47
48--
492.34.1
50