Mellanox/mstflint

32bit platforms fail building: mlxlink_cables_commander.cpp:96:37: error: ‘]’ directive writing 1 byte into a region of size between 0 and 9 [-Werror=format-overflow=]

tzafrir-mellanox opened this issue · 0 comments

Build log: https://buildd.debian.org/status/fetch.php?pkg=mstflint&arch=armhf&ver=4.16.0%2B1-1&stamp=1612359698&raw=0
Error:
libtool: compile: g++ -DHAVE_CONFIG_H -I. -I../.. -I. -I../.. -I../../mtcr_ul -I -I../../mft_utils -I../../mlxreg -I../../mlxlink -I../../include/mtcr_ul -I/usr/include/jsoncpp -Wdate-time -D_FORTIFY_SOURCE=2 -Wall -W -g -MP -MD -pipe -Werror -g -O2 -ffile-prefix-map=/<>=. -fstack-protector-strong -Wformat -Werror=format-security -isystem /usr/local/include -DHAVE_TERMIOS_H -DMST_UL -c mlxlink_reg_parser.cpp -o mlxlink_reg_parser.o >/dev/null 2>&1
mlxlink_cables_commander.cpp: In member function ‘void MlxlinkCablesCommander::writeMCIA(u_int32_t, u_int32_t, u_int32_t, u_int32_t, u_int8_t*, u_int32_t)’:
mlxlink_cables_commander.cpp:96:37: error: ‘]’ directive writing 1 byte into a region of size between 0 and 9 [-Werror=format-overflow=]
96 | sprintf(fieldName, "dword[%d]", i);
| ^
In file included from /usr/include/stdio.h:867,
from /usr/include/c++/10/cstdio:42,
from /usr/include/c++/10/ext/string_conversions.h:43,
from /usr/include/c++/10/bits/basic_string.h:6545,
from /usr/include/c++/10/string:55,
from mlxlink_logger.h:38,
from mlxlink_utils.h:38,
from mlxlink_reg_parser.h:37,
from mlxlink_cables_commander.h:37,
from mlxlink_cables_commander.cpp:33:
/usr/include/arm-linux-gnueabihf/bits/stdio2.h:36:34: note: ‘__builtin___sprintf_chk’ output between 9 and 18 bytes into a destination of size 16
36 | return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
| ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
37 | __bos (__s), __fmt, __va_arg_pack ());
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

There are similar errors on other platforms:
See logs here: https://buildd.debian.org/status/logs.php?pkg=mstflint&ver=4.16.0%2B1-1
The following 32 bit platforms failed in the same way:
armel, armhf, i386, powerpc.
All successful builds were 64 bit platforms.

(Some other platforms failed because they are not supported: m68k, hppa and riscv64)