WindRiver-Labs / source.codeaurora.org.external.qoriq.qoriq-components.restool

Other
2 stars 1 forks source link

RHEL9 compile error #2

Open rjbrown99 opened 2 years ago

rjbrown99 commented 2 years ago

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 - Error

rjbrown99 commented 2 years ago

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.