Hi, I'm seeing a compile failure on RHEL 9, haven't tracked down why just yet -
gcc -Wall -Wstrict-prototypes -Wextra -Wformat -std=gnu99 -Wmissing-prototypes -Wpointer-arith -Winline -Werror -Wundef -Icommon/ -DVERSION=\"la1224rdb-early-access-bsp0.6\" -c restool.c -o restool.orestool.c: In function ‘get_device_file’:restool.c:1223:73: error: ‘sprintf’ writing a terminating nul past the end of the destination [-Werror=format-overflow=]1223 | num_char = sprintf(restool.device_file, "/dev/mc_restool");| ^restool.c:1223:28: note: ‘sprintf’ output 16 bytes into a destination of size 151223 | num_char = sprintf(restool.device_file, "/dev/mc_restool");| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~cc1: all warnings being treated as errorsmake: *** [Makefile:40: restool.o] Error 1
My completely unscientific approach to this was to just edit restool.h and change #define DEV_FILE_SIZE from 15 to 16. It compiles now, but I have no idea what the consequences are for that change.
Hi, I'm seeing a compile failure on RHEL 9, haven't tracked down why just yet -
gcc -Wall -Wstrict-prototypes -Wextra -Wformat -std=gnu99 -Wmissing-prototypes -Wpointer-arith -Winline -Werror -Wundef -Icommon/ -DVERSION=\"la1224rdb-early-access-bsp0.6\" -c restool.c -o restool.o
restool.c: In function ‘get_device_file’:
restool.c:1223:73: error: ‘sprintf’ writing a terminating nul past the end of the destination [-Werror=format-overflow=]
1223 | num_char = sprintf(restool.device_file, "/dev/mc_restool");
| ^
restool.c:1223:28: note: ‘sprintf’ output 16 bytes into a destination of size 15
1223 | num_char = sprintf(restool.device_file, "/dev/mc_restool");
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
make: *** [Makefile:40: restool.o] Error 1
Cleaner image version of the error -