Skip to content
Commit 5a78203f authored by Nicola Mazzucato's avatar Nicola Mazzucato Committed by ronald-cron-arm
Browse files

clark: Fix GCC 7 -Wformat-truncation error



GCC 7 introduces the -Wformat-truncation warning and associated
heuristics. This warning identifies potentially unexpected string
truncation issues by statically range-checking the vararg inputs to
snprintf().

For us, GCC seems to be unable to reliably identify the bounds of the
inputs (cluster_idx, core_idx) even though we have static guarantees in
place as those guarantees are made in a separate compilation unit from
the one in which the error occurs.

This patch allows the compiler to inline the cluster/core count
functions to ensure it can properly ascertain the proper bounds on the
inputs to snprintf().

Change-Id: Ie332561573d33a38063863fa7a4423c0c82543c4
Signed-off-by: Nicola Mazzucato's avatarNicola Mazzucato <nicola.mazzucato@arm.com>
parent 14619a9d
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment