intel / numatop

NumaTOP is an observation tool for runtime memory locality characterization and analysis of processes and threads running on a NUMA system.
BSD 3-Clause "New" or "Revised" License
197 stars 47 forks source link

Various strn* build warnings should be fixed #56

Closed ColinIanKing closed 3 months ago

ColinIanKing commented 4 years ago

Building with gcc 9.3.0 I see multiple build warnings, can these be fixed?

gcc -v Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/9/lto-wrapper OFFLOAD_TARGET_NAMES=nvptx-none:hsa OFFLOAD_TARGET_DEFAULT=1 Target: x86_64-linux-gnu Configured with: ../src/configure -v --with-pkgversion='Ubuntu 9.3.0-12ubuntu1' --with-bugurl=file:///usr/share/doc/gcc-9/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++,gm2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-9 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none,hsa --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu Thread model: posix gcc version 9.3.0 (Ubuntu 9.3.0-12ubuntu1)

make[1]: Entering directory '/home/cking/repos/numatop' CC common/numatop-numatop.o CC common/os/map.lo CC common/os/node.lo CC common/os/os_cmd.lo CC common/os/os_page.lo CC common/os/os_perf.lo CC common/os/os_util.lo In file included from /usr/include/string.h:495, from common/os/os_util.c:35: In function ‘strncpy’, inlined from ‘str_int_extract’ at common/os/os_util.c:394:2, inlined from ‘file_int_extract’ at common/os/os_util.c:452:10: /usr/include/x86_64-linux-gnu/bits/string_fortified.h:106:10: warning: ‘builtin_strncpy’ output truncated before terminating nul copying as many bytes from a string as its length [-Wstringop-truncation] 106 | return _builtinstrncpy_chk (dest, src, len, bos (dest)); | ^~~~~~~~~~~~~~ common/os/os_util.c: In function ‘file_int_extract’: common/os/os_util.c:387:12: note: length computed here 387 | int len = strlen(str); | ^~~ CC common/os/os_win.lo In file included from /usr/include/string.h:495, from common/os/os_win.c:34: In function ‘strncat’, inlined from ‘node_cpu_string’ at common/os/os_win.c:183:20, inlined from ‘os_nodedetail_data’ at common/os/os_win.c:226:2: /usr/include/x86_64-linux-gnu/bits/string_fortified.h:136:10: warning: ‘builtin_strncat_chk’ output truncated before terminating nul copying as many bytes from a string as its length [-Wstringop-truncation] 136 | return builtin_strncat_chk (dest, src, len, bos (dest)); | ^~~~~~~~~~~~~~ common/os/os_win.c: In function ‘os_nodedetail_data’: common/os/os_win.c:183:20: note: length computed here 183 | (void) strncat(s1, s2, strlen(s2)); | ^~~~~~~ In file included from /usr/include/string.h:495, from common/os/os_win.c:34: In function ‘strncat’, inlined from ‘node_cpu_string’ at common/os/os_win.c:173:21, inlined from ‘os_nodedetail_data’ at common/os/os_win.c:226:2: /usr/include/x86_64-linux-gnu/bits/string_fortified.h:136:10: warning: ‘builtin___strncat_chk’ output truncated before terminating nul copying as many bytes from a string as its length [-Wstringop-truncation] 136 | return builtin_strncat_chk (dest, src, len, bos (dest)); | ^~~~~~~~~~~~~~ common/os/os_win.c: In function ‘os_nodedetail_data’: common/os/os_win.c:173:21: note: length computed here 173 | (void) strncat(s2, s3, strlen(s3)); | ^~~~~~~ In file included from /usr/include/string.h:495, from common/os/os_win.c:34: In function ‘strncat’, inlined from ‘node_cpu_string’ at common/os/os_win.c:176:20, inlined from ‘os_nodedetail_data’ at common/os/os_win.c:226:2: /usr/include/x86_64-linux-gnu/bits/string_fortified.h:136:10: warning: ‘builtin___strncat_chk’ output truncated before terminating nul copying as many bytes from a string as its length [-Wstringop-truncation] 136 | return builtin_strncat_chk (dest, src, len, bos (dest)); | ^~~~~~~~~~~~~~ common/os/os_win.c: In function ‘os_nodedetail_data’: common/os/os_win.c:176:20: note: length computed here 176 | (void) strncat(s1, s2, strlen(s2)); | ^~~~~~~ In file included from /usr/include/string.h:495, from common/os/os_win.c:34: In function ‘strncat’, inlined from ‘node_cpu_string’ at common/os/os_win.c:144:17, inlined from ‘os_nodedetail_data’ at common/os/os_win.c:226:2: /usr/include/x86_64-linux-gnu/bits/string_fortified.h:136:10: warning: ‘builtin___strncat_chk’ output truncated before terminating nul copying as many bytes from a string as its length [-Wstringop-truncation] 136 | return builtin_strncat_chk (dest, src, len, bos (dest)); | ^~~~~~~~~~~~~~ common/os/os_win.c: In function ‘os_nodedetail_data’: common/os/os_win.c:144:17: note: length computed here 144 | (void) strncat(s1, s2, strlen(s2)); | ^~~~~~~ CC common/os/pfwrapper.lo CC common/os/plat.lo CC common/os/sym.lo CC common/cmd.lo CC common/disp.lo CC common/lwp.lo CC common/page.lo CC common/perf.lo CC common/proc.lo CC common/reg.lo CC common/ui_perf_map.lo CC common/util.lo CC common/win.lo In file included from /usr/include/string.h:495, from common/win.c:36: In function ‘strncpy’, inlined from ‘topnproc_data_save’ at common/win.c:358:9, inlined from ‘topnproc_data_show.isra.0’ at common/win.c:441:3: /usr/include/x86_64-linux-gnu/bits/string_fortified.h:106:10: warning: ‘builtin_strncpy’ output may be truncated copying 12 bytes from a string of length 15 [-Wstringop-truncation] 106 | return _builtinstrncpy_chk (dest, src, len, bos (__dest)); | ^~~~~~~~~~~~~~ CC intel/bdw.lo CC intel/nhm.lo CC intel/plat.lo CC intel/skl.lo CC intel/snb.lo CC intel/ui_perf_map.lo CC intel/util.lo CC intel/wsm.lo CCLD libnumatop.la copying selected object files to avoid basename conflicts... CCLD numatop CC test/mgen/mgen-mgen.o CC test/mgen/intel/mgen-util.o CCLD mgen make[1]: Leaving directory '/home/cking/repos/numatop'

ak-intel commented 3 months ago

Patches merged