NJU-ProjectN / nemu

NJU EMUlator, a full system x86/mips32/riscv32/riscv64 emulator for teaching
Other
858 stars 184 forks source link

error: array subscript ‘struct gdb_conn[0]’ is partly outside array bounds of ‘unsigned char[8]’ #59

Closed Yandong23 closed 1 year ago

Yandong23 commented 1 year ago

This error is raised after i upgraded my system from ubuntu 20.04 to 22.04. The whole error log is as follows:

i try to fix this issue by disabling the "Werror=array-bounds" check by following codes added in the makefile: CFLAGS += -Wno-array-bounds

Then i successfully "make ISA=riscv run", and start nemu.

So could you help to check if these codes have some bug with ubuntu 22.04, or there may have some other ways to fix it. Thanks

sashimi-yzh commented 1 year ago

I can not reproduce the error in ubuntu22.04. Which version of NEMU do you use?

Yandong23 commented 1 year ago

I clone the code from Yanyan's wiki--2020年秋季《计算机系统基础》 The NEMU was cloned by following code in PA0---Getting Source code for PAs

git clone -b 2020 https://github.com/NJU-ProjectN/ics-pa.git ics2020 git branch -m master bash init.sh nemu bash init.sh abstract-machine

I'm not sure about the version of this NEMU

sashimi-yzh commented 1 year ago

We recommend using the 2022 version. See https://nju-projectn.github.io/ics-pa-gitbook/ics2022/ for more details.

Yandong23 commented 1 year ago

Thanks!