aboutsummaryrefslogtreecommitdiff
path: root/lib/test_fortify/write_overflow-strncpy-src.c
diff options
context:
space:
mode:
authorYanan Wang <[email protected]>2021-06-10 16:54:18 +0800
committerPaolo Bonzini <[email protected]>2021-06-10 07:46:10 -0400
commit95bf69b400f41fbba7a2dc49b0152dd7bdc9a508 (patch)
tree3f9a10c4f225384f9c6e1b1aa7b965728cb5fa89 /lib/test_fortify/write_overflow-strncpy-src.c
parent218bf772bddd221489c38dde6ef8e917131161f6 (diff)
KVM: selftests: Fix compiling errors when initializing the static structure
Errors like below were produced from test_util.c when compiling the KVM selftests on my local platform. lib/test_util.c: In function 'vm_mem_backing_src_alias': lib/test_util.c:177:12: error: initializer element is not constant .flag = anon_flags, ^~~~~~~~~~ lib/test_util.c:177:12: note: (near initialization for 'aliases[0].flag') The reason is that we are using non-const expressions to initialize the static structure, which will probably trigger a compiling error/warning on stricter GCC versions. Fix it by converting the two const variables "anon_flags" and "anon_huge_flags" into more stable macros. Fixes: b3784bc28ccc0 ("KVM: selftests: refactor vm_mem_backing_src_type flags") Reported-by: Zenghui Yu <[email protected]> Signed-off-by: Yanan Wang <[email protected]> Message-Id: <[email protected]> Signed-off-by: Paolo Bonzini <[email protected]>
Diffstat (limited to 'lib/test_fortify/write_overflow-strncpy-src.c')
0 files changed, 0 insertions, 0 deletions