Skip to content

Commit 9800250

Browse files
committed
build: Add fix for GCC null-dereference check
Turn off GCC null-dereference check on specific test code, which should not be executed anyway. Signed-off-by: Gabor Toth <gabor.toth@arm.com> Change-Id: Icf4d90ad92a63ffe170c43e8ff065e7ffb940008
1 parent 71dd561 commit 9800250

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

api-tests/ff/ipc/test_i047/test_supp_i047.c

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/** @file
2-
* Copyright (c) 2019-2024, Arm Limited or its affiliates. All rights reserved.
2+
* Copyright (c) 2019-2025, Arm Limited or its affiliates. All rights reserved.
33
* SPDX-License-Identifier : Apache-2.0
44
*
55
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -206,9 +206,21 @@ int32_t server_test_psa_get_with_invalid_msg_pointer(void)
206206
val->print(PRINT_ERROR, "\tFailed to set boot flag after check\n", 0);
207207
}
208208

209+
/* GCC null-dereference check fails because of invalid_msg, however this
210+
* part should not be reached according the comment above.
211+
*/
212+
#if defined(__GNUC__)
213+
#pragma GCC diagnostic push
214+
#pragma GCC diagnostic ignored "-Wnull-dereference"
215+
#endif
216+
209217
/* Reject the connection */
210218
psa->reply(invalid_msg->handle, PSA_ERROR_CONNECTION_REFUSED);
211219

220+
#if defined(__GNUC__)
221+
#pragma GCC diagnostic pop
222+
#endif
223+
212224
return VAL_STATUS_SPM_FAILED;
213225
}
214226

0 commit comments

Comments
 (0)