Avoid a spurious compiler warning that causes build to fail with GCC and MinSizeRel build
Closed, ResolvedPublic

Description

When I build the latest TF-M master with GCC and the 'MinSizeRelease' option, I get the following warning:

tf-m/secure_fw/core/tfm_secure_api.c: In function 'tfm_core_sfn_request_handler':
tf-m/secure_fw/core/tfm_secure_api.c:96:26: error: 'iovec_args' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     *(--dst) = (uint32_t)iovec_args->out_vec;
                          ^~~~~~~~~~
tf-m/secure_fw/core/tfm_secure_api.c:365:26: note: 'iovec_args' was declared here
     struct iovec_args_t *iovec_args;
                          ^~~~~~~~~~

Because we have '-Werror' set, the build fails.

The same warning does not appear with the 'Debug' build type.

The warning is spurious, but I think the easiest solution is probably to modify the code to avoid triggering it.

jf549 created this task.Jan 24 2019, 1:36 PM
jf549 triaged this task as Normal priority.
jf549 closed this task as Resolved.Jan 25 2019, 3:27 PM