On 01.06.21 20:45, Ralf Ramsauer wrote: > Hi, > > On 18/05/2021 17:00, Florian Bezdeka wrote: >>>> /home/prashant/jailhouse/hypervisor/arch/x86/vcpu.c: In function >>>> ‘vcpu_reset’: >>>> /home/prashant/jailhouse/hypervisor/arch/x86/vcpu.c:429:9: warning: >>>> ‘memset’ offset [0, 127] is out of the bounds [0, 0] [-Warray-bounds] >>>> 429 | memset(&cpu_data->guest_regs, 0, >>>> sizeof(cpu_data->guest_regs)); >>>> | >>>> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >> This is a warning and treated as error due to -Wall. >> >> This warning is GCC 11 specific, the code compiles with GCC 10, but >> fails with GCC 11. >> >> I looked into that a few days ago and considered that as gcc bug. In my >> eyes the array boundarys are not correctly "detected" by gcc and that >> might be the reason for the warning. Not sure if it was already reported >> upstream to the gcc guys. > > Do you have workaround to suppress this warning? I just hit that warning > as well…
I reported [1] to the gcc project some days ago. It has been marked as duplicate of [2] which is not resolved yet. There are several workarounds mentioned in [2], maybe volatile does the trick... [1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100834 [2] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99578 HTH, Florian > > Thanks > Ralf > -- Siemens AG, T RDA IOT Corporate Competence Center Embedded Linux -- You received this message because you are subscribed to the Google Groups "Jailhouse" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/jailhouse-dev/cbfe2115-6595-4a17-f400-86efd51028d1%40siemens.com.
