The original type of int64_t depends on whether 32-bit or 64-bit
environment. In detail, on the 32-bit environment, int64_t is long long
int while, on the 64-bit environment, it is long int. Therefore, using
%lld for the scanf format specifier of int64_t on the 64-bit environment
causes a build warning. This patch fixes the following build warning [1]
using the special purpose format specifier, SCNd64, for int64_t.
[1] "warning: format '%lld' expects
argument of type 'long long int *', but argument 3 has type 'int64_t *
{aka long int *}' [-Wformat=]"
Change-Id: I6a4cb301858635b2cef91fdee8d04540413f7bec
Signed-off-by: Wook Song <wook16.song@samsung.com>
Reviewed-by: Chanwoo Choi <cw00.choi@samsung.com>
*/
+#include <inttypes.h>
#include <stdio.h>
#include <errno.h>
#include <fcntl.h>
}
for (i = 0; i < policy->num_pass_cpu_stats; i++) {
- ret = fscanf(fp_stats, "%lld %d %d %d",
+ ret = fscanf(fp_stats, "%" SCNd64 "%d %d %d",
&stats[i].time,
&stats[i].freq,
&stats[i].freq_new,