Advertisement
goatbar

clang static analyzer on mb-system mbcopy.cc

Dec 28th, 2019
168
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 9.13 KB | None | 0 0
  1. scan-build-9 make mbcopy.lo
  2. scan-build: Using '/usr/lib/llvm-9/bin/clang' for static analysis
  3. depbase=`echo mbcopy.lo | sed 's|[^/]*$|.deps/&|;s|\.lo$||'`;\
  4. /bin/sh ../../libtool  --tag=CXX   --mode=compile /usr/share/clang/scan-build-9/bin/../libexec/c++-analyzer -DHAVE_CONFIG_H -I. -I../../src/mbio  -I../../src/mbio -I../../src/mbaux -I../../src/gsf  -I/usr/include/gmt -I/usr/include    -g -O2 -MT mbcopy.lo -MD -MP -MF $depbase.Tpo -c -o mbcopy.lo mbcopy.cc &&\
  5. mv -f $depbase.Tpo $depbase.Plo
  6. libtool: compile:  /usr/share/clang/scan-build-9/bin/../libexec/c++-analyzer -DHAVE_CONFIG_H -I. -I../../src/mbio -I../../src/mbio -I../../src/mbaux -I../../src/gsf -I/usr/include/gmt -I/usr/include -g -O2 -MT mbcopy.lo -MD -MP -MF .deps/mbcopy.Tpo -c mbcopy.cc  -fPIC -DPIC -o .libs/mbcopy.o
  7. mbcopy.cc:1475:5: warning: Value stored to 'mb_ping' is never read
  8.     mb_ping = &(records->mb_ping);
  9.     ^         ~~~~~~~~~~~~~~~~~~~
  10. mbcopy.cc:1567:11: warning: Value stored to 'status' is never read
  11.           status = MB_FAILURE;
  12.           ^        ~~~~~~~~~~
  13. mbcopy.cc:1574:11: warning: Value stored to 'status' is never read
  14.           status = MB_FAILURE;
  15.           ^        ~~~~~~~~~~
  16. mbcopy.cc:1593:32: warning: Array access (via field 'beam_flags') results in a null pointer dereference
  17.         mb_ping->beam_flags[i] = istore->beamflag[i];
  18.                  ~~~~~~~~~~    ^
  19. mbcopy.cc:1595:29: warning: Array access (via field 'depth') results in a null pointer dereference
  20.           mb_ping->depth[i] = istore->bath[i];
  21.                    ~~~~~    ^
  22. mbcopy.cc:1596:36: warning: Array access (via field 'across_track') results in a null pointer dereference
  23.           mb_ping->across_track[i] = istore->bath_acrosstrack[i];
  24.                    ~~~~~~~~~~~~    ^
  25. mbcopy.cc:1597:35: warning: Array access (via field 'along_track') results in a null pointer dereference
  26.           mb_ping->along_track[i] = istore->bath_alongtrack[i];
  27.                    ~~~~~~~~~~~    ^
  28. mbcopy.cc:1598:35: warning: Array access (via field 'travel_time') results in a null pointer dereference
  29.           mb_ping->travel_time[i] = 0.25 * (double)istore->range[i] / (double)istore->sample_rate;
  30.                    ~~~~~~~~~~~    ^
  31. mbcopy.cc:1604:34: warning: Array access (via field 'beam_angle') results in a null pointer dereference
  32.           mb_ping->beam_angle[i] = theta;
  33.                    ~~~~~~~~~~    ^
  34. mbcopy.cc:1609:42: warning: Array access (via field 'beam_angle_forward') results in a null pointer dereference
  35.           mb_ping->beam_angle_forward[i] = phi;
  36.                    ~~~~~~~~~~~~~~~~~~    ^
  37. mbcopy.cc:1612:29: warning: Array access (via field 'depth') results in a null pointer dereference
  38.           mb_ping->depth[i] = 0.0;
  39.                    ~~~~~    ^
  40. mbcopy.cc:1613:36: warning: Array access (via field 'across_track') results in a null pointer dereference
  41.           mb_ping->across_track[i] = 0.0;
  42.                    ~~~~~~~~~~~~    ^
  43. mbcopy.cc:1614:35: warning: Array access (via field 'along_track') results in a null pointer dereference
  44.           mb_ping->along_track[i] = 0.0;
  45.                    ~~~~~~~~~~~    ^
  46. mbcopy.cc:1615:35: warning: Array access (via field 'travel_time') results in a null pointer dereference
  47.           mb_ping->travel_time[i] = 0.0;
  48.                    ~~~~~~~~~~~    ^
  49. mbcopy.cc:1616:34: warning: Array access (via field 'beam_angle') results in a null pointer dereference
  50.           mb_ping->beam_angle[i] = 0.0;
  51.                    ~~~~~~~~~~    ^
  52. mbcopy.cc:1617:42: warning: Array access (via field 'beam_angle_forward') results in a null pointer dereference
  53.           mb_ping->beam_angle_forward[i] = 0;
  54.                    ~~~~~~~~~~~~~~~~~~    ^
  55. mbcopy.cc:1621:34: warning: Array access (via field 'mr_amplitude') results in a null pointer dereference
  56.         mb_ping->mr_amplitude[i] = istore->amp[i];
  57.                  ~~~~~~~~~~~~    ^
  58. mbcopy.cc:1695:11: warning: Value stored to 'status' is never read
  59.           status = MB_FAILURE;
  60.           ^        ~~~~~~~~~~
  61. mbcopy.cc:1737:3: warning: Value stored to 'status' is never read
  62.   status &= mb_fbtversion(verbose, &fbtversion);
  63.   ^         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  64. mbcopy.cc:2263:5: warning: Value stored to 'status' is never read
  65.     status = mb_put_comment(verbose, ombio_ptr, comment, &error);
  66.     ^        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  67. mbcopy.cc:2268:5: warning: Value stored to 'status' is never read
  68.     status = mb_put_comment(verbose, ombio_ptr, comment, &error);
  69.     ^        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  70. mbcopy.cc:2287:5: warning: Value stored to 'status' is never read
  71.     status = mb_put_comment(verbose, ombio_ptr, comment, &error);
  72.     ^        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  73. mbcopy.cc:2292:5: warning: Value stored to 'status' is never read
  74.     status = mb_put_comment(verbose, ombio_ptr, comment, &error);
  75.     ^        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  76. mbcopy.cc:2297:5: warning: Value stored to 'status' is never read
  77.     status = mb_put_comment(verbose, ombio_ptr, comment, &error);
  78.     ^        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  79. mbcopy.cc:2302:5: warning: Value stored to 'status' is never read
  80.     status = mb_put_comment(verbose, ombio_ptr, comment, &error);
  81.     ^        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  82. mbcopy.cc:2308:7: warning: Value stored to 'status' is never read
  83.       status = mb_put_comment(verbose, ombio_ptr, comment, &error);
  84.       ^        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  85. mbcopy.cc:2313:7: warning: Value stored to 'status' is never read
  86.       status = mb_put_comment(verbose, ombio_ptr, comment, &error);
  87.       ^        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  88. mbcopy.cc:2319:5: warning: Value stored to 'status' is never read
  89.     status = mb_put_comment(verbose, ombio_ptr, comment, &error);
  90.     ^        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  91. mbcopy.cc:2324:5: warning: Value stored to 'status' is never read
  92.     status = mb_put_comment(verbose, ombio_ptr, comment, &error);
  93.     ^        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  94. mbcopy.cc:2329:5: warning: Value stored to 'status' is never read
  95.     status = mb_put_comment(verbose, ombio_ptr, comment, &error);
  96.     ^        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  97. mbcopy.cc:2334:5: warning: Value stored to 'status' is never read
  98.     status = mb_put_comment(verbose, ombio_ptr, comment, &error);
  99.     ^        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  100. mbcopy.cc:2339:5: warning: Value stored to 'status' is never read
  101.     status = mb_put_comment(verbose, ombio_ptr, comment, &error);
  102.     ^        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  103. mbcopy.cc:2344:5: warning: Value stored to 'status' is never read
  104.     status = mb_put_comment(verbose, ombio_ptr, comment, &error);
  105.     ^        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  106. mbcopy.cc:2350:5: warning: Value stored to 'status' is never read
  107.     status = mb_put_comment(verbose, ombio_ptr, comment, &error);
  108.     ^        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  109. mbcopy.cc:2356:5: warning: Value stored to 'status' is never read
  110.     status = mb_put_comment(verbose, ombio_ptr, comment, &error);
  111.     ^        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  112. mbcopy.cc:2361:5: warning: Value stored to 'status' is never read
  113.     status = mb_put_comment(verbose, ombio_ptr, comment, &error);
  114.     ^        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  115. mbcopy.cc:2366:5: warning: Value stored to 'status' is never read
  116.     status = mb_put_comment(verbose, ombio_ptr, comment, &error);
  117.     ^        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  118. mbcopy.cc:2384:5: warning: Value stored to 'status' is never read
  119.     status = MB_SUCCESS;
  120.     ^        ~~~~~~~~~~
  121. mbcopy.cc:2495:25: warning: The right operand of '<' is a garbage value
  122.       for (int j = 0; j < offset_bath; j++) {
  123.                         ^ ~~~~~~~~~~~
  124. mbcopy.cc:2530:25: warning: The right operand of '<' is a garbage value
  125.       for (int j = 0; j < offset_amp; j++) {
  126.                         ^ ~~~~~~~~~~
  127. mbcopy.cc:2542:25: warning: The right operand of '<' is a garbage value
  128.       for (int j = 0; j < offset_ss; j++) {
  129.                         ^ ~~~~~~~~~
  130. mbcopy.cc:2662:16: warning: 3rd function call argument is an uninitialized value
  131.       status = mb_put_all(verbose, ombio_ptr, ostore_ptr, false, kind, time_i, time_d, navlon, navlat, speed, heading,
  132.                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  133. mbcopy.cc:2692:5: warning: Value stored to 'status' is never read
  134.     status &= mb_memory_list(verbose, &error);
  135.     ^         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  136. 43 warnings generated.
  137. libtool: compile:  /usr/share/clang/scan-build-9/bin/../libexec/c++-analyzer -DHAVE_CONFIG_H -I. -I../../src/mbio -I../../src/mbio -I../../src/mbaux -I../../src/gsf -I/usr/include/gmt -I/usr/include -g -O2 -MT mbcopy.lo -MD -MP -MF .deps/mbcopy.Tpo -c mbcopy.cc -o mbcopy.o >/dev/null 2>&1
  138. scan-build: 86 bugs found.
  139. scan-build: Run 'scan-view /tmp/scan-build-2019-12-28-001212-90305-1' to examine bug reports.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement