Skip to content

Issues with sinc blot option and compiler warnings/bugs #209

@mcara

Description

@mcara

After cleaning up most warnings on Linux with #208 , there are still 4 warnings remaining that suggest that memory is not accessed correctly and this likely would lead to wrong/random results. For the very least we need to understand the algorithm and the reason for negative indices.

Here are the warnings:

  /project/src/cdrizzleblot.c:673:27: warning: array subscript -1 is below array bounds of ‘float[15]’ [-Warray-bounds=]
    673 |                 px = taper[j - 1] / ax;
        |                      ~~~~~^~~~~~~
  /project/src/cdrizzleblot.c: In function ‘interpolate_sinc’:
  /project/src/cdrizzleblot.c:595:11: note: while referencing ‘taper’
    595 |     float taper[INTERPOLATE_SINC_NCONV];
        |           ^~~~~
  In function ‘interpolate_sinc_’,
      inlined from ‘interpolate_sinc’ at /project/src/cdrizzleblot.c:784:12:
  /project/src/cdrizzleblot.c:681:27: warning: array subscript -1 is below array bounds of ‘float[15]’ [-Warray-bounds=]
    681 |                 py = taper[j - 1] / ay;
        |                      ~~~~~^~~~~~~
  /project/src/cdrizzleblot.c: In function ‘interpolate_sinc’:
  /project/src/cdrizzleblot.c:595:11: note: while referencing ‘taper’
    595 |     float taper[INTERPOLATE_SINC_NCONV];
        |           ^~~~~
  In function ‘interpolate_sinc_’,
      inlined from ‘interpolate_sinc’ at /project/src/cdrizzleblot.c:784:12:
  /project/src/cdrizzleblot.c:685:15: warning: array subscript -1 is below array bounds of ‘float[15]’ [-Warray-bounds=]
    685 |             ac[j - 1] = px;
        |             ~~^~~~~~~
  /project/src/cdrizzleblot.c: In function ‘interpolate_sinc’:
  /project/src/cdrizzleblot.c:596:11: note: while referencing ‘ac’
    596 |     float ac[INTERPOLATE_SINC_NCONV], ar[INTERPOLATE_SINC_NCONV];
        |           ^~
  In function ‘interpolate_sinc_’,
      inlined from ‘interpolate_sinc’ at /project/src/cdrizzleblot.c:784:12:
  /project/src/cdrizzleblot.c:686:15: warning: array subscript -1 is below array bounds of ‘float[15]’ [-Warray-bounds=]
    686 |             ar[j - 1] = py;
        |             ~~^~~~~~~
  /project/src/cdrizzleblot.c: In function ‘interpolate_sinc’:
  /project/src/cdrizzleblot.c:596:39: note: while referencing ‘ar’
    596 |     float ac[INTERPOLATE_SINC_NCONV], ar[INTERPOLATE_SINC_NCONV];
        |                                       ^~

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions