rockchip-linux / rkdeveloptool

GNU General Public License v2.0
146 stars 85 forks source link

make fails on WSL2 Debian and Raspberry Pi #98

Closed m0dbot closed 3 months ago

m0dbot commented 3 months ago

I'm getting this error when trying to follow the install guide:

I've installed all mentioned packages and OS is up to date.

$ make
make[1]: Entering directory '/home/me/rkdeveloptool'
g++ -DHAVE_CONFIG_H -I. -I./cfg  -Wall -Werror -Wextra -Wreturn-type -fno-strict-aliasing -D_FILE_OFFSET_BITS=64 -D_LARGE_FILE -I/usr/include/libusb-1.0   -g -O2 -MT main.o -MD -MP -MF .deps/main.Tpo -c -o main.o main.cpp
main.cpp: In function ‘bool _Z9mergeBootv.part.0()’:
main.cpp:1493:36: error: ‘%s’ directive output may be truncated writing up to 557 bytes into a region of size 5 [-Werror=format-truncation=]
 1493 |  snprintf(buffer, sizeof(buffer), "%s", chip);
      |                                    ^~
......
 1534 |   chipType = convertChipType(chip + 2);
      |              ~~~~~~~~~~~~~~~~~~~~~~~~~
main.cpp:1493:10: note: ‘snprintf’ output between 1 and 558 bytes into a destination of size 5
 1493 |  snprintf(buffer, sizeof(buffer), "%s", chip);
      |  ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1plus: all warnings being treated as errors
make[1]: *** [Makefile:491: main.o] Error 1
make[1]: Leaving directory '/home/me/rkdeveloptool'
make: *** [Makefile:511: all-recursive] Error 1

One machine is a Windows 10 x64 intel with WSL2/Debian and the other is a Raspberry Pi Zero W2

m0dbot commented 3 months ago

Duplicate of #55