rockchip-linux / rkdeveloptool

GNU General Public License v2.0
159 stars 91 forks source link

Build is failing on Fedora 32 #47

Closed vd-rd closed 4 years ago

vd-rd commented 4 years ago

Hello, When i follow the instructions listed on the readme, build is failing with the following error (make step):

main.cpp: In function ‘bool _Z9mergeBootv.part.0()’:
main.cpp:1541:36: error: ‘%s’ directive output may be truncated writing up to 557 bytes into a region of size 5 [-Werror=format-truncation=]
 1541 |  snprintf(buffer, sizeof(buffer), "%s", chip);
      |                                    ^~
......
 1582 |   chipType = convertChipType(chip + 2);
      |              ~~~~~~~~~~~~~~~~~~~~~~~~~
main.cpp:1541:10: note: ‘snprintf’ output between 1 and 558 bytes into a destination of size 5
 1541 |  snprintf(buffer, sizeof(buffer), "%s", chip);
      |  ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1plus: all warnings being treated as errors
make[1]: *** [Makefile:471: main.o] Error 1

Previous instructions complete with no errors. gcc-c++ is g++ (GCC) 10.1.1 20200507 (Red Hat 10.1.1-1)

Thank you, Vadim.

DaveWK commented 4 years ago

just ran into this on f32 as well -- looks like others are having this problem too: https://github.com/rockchip-linux/rkdeveloptool/issues/25

there's a workaround in that issue (albeit a bit reckless to remove -Werror as a long-term fix)

drmckay commented 4 years ago

51 pull request resolves this issue...

if you apply the patch you can build it with sh mkdir build && cd build && cmake .. && make

vd-rd commented 4 years ago

Thank you for that one, i've tested it and it works. It seems that no one from the main repo maintains this project anymore 😞