cyclops-community / ctf

Cyclops Tensor Framework: parallel arithmetic on multidimensional arrays
Other
202 stars 54 forks source link

Warnings #143

Open scemama opened 2 years ago

scemama commented 2 years ago

Hi, thank you for your software. It compiled, but I got the following warnings when compiling:

int_timer.cxx: In function ‘void CTF::print_timers(const char*)’:
int_timer.cxx:225:24: warning: ‘%s’ directive writing up to 299 bytes into a region of size 253 [-Wformat-overflow=]
  225 |       sprintf(heading,"%s",part);
      |                        ^~  ~~~~
In file included from /usr/include/stdio.h:867,
                 from /usr/include/c++/9/cstdio:42,
                 from /usr/include/c++/9/ext/string_conversions.h:43,
                 from /usr/include/c++/9/bits/basic_string.h:6496,
                 from /usr/include/c++/9/string:55,
                 from ../interface/common.h:4,
                 from util.h:6,
                 from int_timer.cxx:10:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:36:34: note: ‘__builtin___sprintf_chk’ output between 1 and 300 bytes into a destination of size 253
   36 |   return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
      |          ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   37 |       __bos (__s), __fmt, __va_arg_pack ());
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
int_timer.cxx:234:24: warning: ‘%s’ directive writing up to 299 bytes into a region of size 253 [-Wformat-overflow=]
  234 |       sprintf(heading,"%s",part);
      |                        ^~  ~~~~
In file included from /usr/include/stdio.h:867,
                 from /usr/include/c++/9/cstdio:42,
                 from /usr/include/c++/9/ext/string_conversions.h:43,
                 from /usr/include/c++/9/bits/basic_string.h:6496,
                 from /usr/include/c++/9/string:55,
                 from ../interface/common.h:4,
                 from util.h:6,
                 from int_timer.cxx:10:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:36:34: note: ‘__builtin___sprintf_chk’ output between 1 and 300 bytes into a destination of size 253
   36 |   return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
      |          ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   37 |       __bos (__s), __fmt, __va_arg_pack ());
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

untyped_tensor.cxx: In member function ‘int CTF_int::tensor::sparsify(std::function<bool(const char*)>)’:
untyped_tensor.cxx:1570:15: warning: argument to variable-length array is too large [-Wvla-larger-than=]
 1570 |       int64_t nnz_blk_old[calc_nvirt()];
      |               ^~~~~~~~~~~
untyped_tensor.cxx:1570:15: note: limit is 9223372036854775807 bytes, but argument is 18446744073709551608

mpicxx -O3 -fopenmp -Wall  -D_POSIX_C_SOURCE=200112L -D__STDC_LIMIT_MACROS -DFTN_UNDERSCORE=1 -DUSE_LAPACK   -c summation.cxx -o /home/scemama/ctf/obj/summation.o
summation.cxx: In member function ‘int CTF_int::summation::home_sum_tsr(bool, bool)’:
summation.cxx:1012:21: warning: ‘op_A’ may be used uninitialized in this function [-Wmaybe-uninitialized]
 1012 |           A->sr->mul(op_A, alpha, tmp_A);
      |           ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~

int_timer.cxx: In function ‘void CTF::print_timers(const char*)’:
int_timer.cxx:225:24: warning: ‘%s’ directive writing up to 299 bytes into a region of size 253 [-Wformat-overflow=]
  225 |       sprintf(heading,"%s",part);
      |                        ^~  ~~~~
In file included from /usr/include/stdio.h:867,
                 from /usr/include/c++/9/cstdio:42,
                 from /usr/include/c++/9/ext/string_conversions.h:43,
                 from /usr/include/c++/9/bits/basic_string.h:6496,
                 from /usr/include/c++/9/string:55,
                 from ../interface/common.h:4,
                 from util.h:6,
                 from int_timer.cxx:10:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:36:34: note: ‘__builtin___sprintf_chk’ output between 1 and 300 bytes into a destination of size 253
   36 |   return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
      |          ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   37 |       __bos (__s), __fmt, __va_arg_pack ());
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
int_timer.cxx:234:24: warning: ‘%s’ directive writing up to 299 bytes into a region of size 253 [-Wformat-overflow=]
  234 |       sprintf(heading,"%s",part);
      |                        ^~  ~~~~
In file included from /usr/include/stdio.h:867,
                 from /usr/include/c++/9/cstdio:42,
                 from /usr/include/c++/9/ext/string_conversions.h:43,
                 from /usr/include/c++/9/bits/basic_string.h:6496,
                 from /usr/include/c++/9/string:55,
                 from ../interface/common.h:4,
                 from util.h:6,
                 from int_timer.cxx:10:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:36:34: note: ‘__builtin___sprintf_chk’ output between 1 and 300 bytes into a destination of size 253
   36 |   return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
      |          ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   37 |       __bos (__s), __fmt, __va_arg_pack ());
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

summation.cxx: In member function ‘int CTF_int::summation::home_sum_tsr(bool, bool)’:
summation.cxx:1012:21: warning: ‘op_A’ may be used uninitialized in this function [-Wmaybe-uninitialized]
 1012 |           A->sr->mul(op_A, alpha, tmp_A);
      |           ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~

In file included from ../include/../src/interface/tensor.h:1288,
                 from ../include/ctf.hpp:17,
                 from ctf_ext.h:2,
                 from ctf_ext.cxx:1:
../include/../src/interface/multilinear.cxx: In function ‘void CTF::svd(CTF::Tensor<dtype>&, const char*, const CTF::Idx_Tensor&, const CTF::Idx_Tensor&, const CTF::Idx_Tensor&, int, double, bool, int, int) [with dtype = float]’:
../include/../src/interface/multilinear.cxx:382:7: warning: ‘idx_aux_VT’ may be used uninitialized in this function [-Wmaybe-uninitialized]
  382 |       if (i>idx_aux_VT){
      |       ^~
../include/../src/interface/multilinear.cxx:302:9: warning: ‘idx_aux_U’ may be used uninitialized in this function [-Wmaybe-uninitialized]
  302 |     int idx_aux_U;
      |         ^~~~~~~~~
../include/../src/interface/multilinear.cxx: In function ‘void CTF::svd(CTF::Tensor<dtype>&, const char*, const CTF::Idx_Tensor&, const CTF::Idx_Tensor&, const CTF::Idx_Tensor&, int, double, bool, int, int) [with dtype = double]’:
../include/../src/interface/multilinear.cxx:382:7: warning: ‘idx_aux_VT’ may be used uninitialized in this function [-Wmaybe-uninitialized]
  382 |       if (i>idx_aux_VT){
      |       ^~
../include/../src/interface/multilinear.cxx:302:9: warning: ‘idx_aux_U’ may be used uninitialized in this function [-Wmaybe-uninitialized]
  302 |     int idx_aux_U;
      |         ^~~~~~~~~
../include/../src/interface/multilinear.cxx: In function ‘void CTF::svd(CTF::Tensor<dtype>&, const char*, const CTF::Idx_Tensor&, const CTF::Idx_Tensor&, const CTF::Idx_Tensor&, int, double, bool, int, int) [with dtype = std::complex<float>]’:
../include/../src/interface/multilinear.cxx:382:7: warning: ‘idx_aux_VT’ may be used uninitialized in this function [-Wmaybe-uninitialized]
  382 |       if (i>idx_aux_VT){
      |       ^~
../include/../src/interface/multilinear.cxx:302:9: warning: ‘idx_aux_U’ may be used uninitialized in this function [-Wmaybe-uninitialized]
  302 |     int idx_aux_U;
      |         ^~~~~~~~~
../include/../src/interface/multilinear.cxx: In function ‘void CTF::svd(CTF::Tensor<dtype>&, const char*, const CTF::Idx_Tensor&, const CTF::Idx_Tensor&, const CTF::Idx_Tensor&, int, double, bool, int, int) [with dtype = std::complex<double>]’:
../include/../src/interface/multilinear.cxx:382:7: warning: ‘idx_aux_VT’ may be used uninitialized in this function [-Wmaybe-uninitialized]
  382 |       if (i>idx_aux_VT){
      |       ^~
../include/../src/interface/multilinear.cxx:302:9: warning: ‘idx_aux_U’ may be used uninitialized in this function [-Wmaybe-uninitialized]
  302 |     int idx_aux_U;
      |         ^~~~~~~~~

best, Anthony