Skip to content

Resolve compiler warnings #5

@wkearn

Description

@wkearn

See #4

We will need to resolve these compiler warnings before moving forward. I've copied the CI log below.

The warnings are almost all declared but unused variables, so the first step is to go through the code and ensure that these variables indeed should not be used. If so, their declarations should be removed. If they should be used, then there is a bug somewhere that needs to be fixed.

The other warning is that main does not have a return type in src/swt.c. Add an int before main to fix this.

Once these warnings are resolved, I will merge #4, which will prevent us from introducing code that triggers additional compiler warnings.

2026-02-27T12:08:23.8004847Z c99 -Werror -Wall -Wextra -Wpedantic -Wno-unused-parameter -c src/swt.c -o src/swt.o
2026-02-27T12:08:23.8661630Z src/swt.c:44:1: error: return type defaults to ‘int’ [-Werror=implicit-int]
2026-02-27T12:08:23.8663415Z    44 | main(int argc, char *argv[])
2026-02-27T12:08:23.8664776Z       | ^~~~
2026-02-27T12:08:23.8859723Z src/swt.c: In function ‘PostProcess’:
2026-02-27T12:08:23.8862522Z src/swt.c:176:19: error: unused variable ‘maxratioOld’ [-Werror=unused-variable]
2026-02-27T12:08:23.8866174Z   176 |   float maxratio, maxratioOld;         /*'success parameters' driving the routine*/
2026-02-27T12:08:23.8868750Z       |                   ^~~~~~~~~~~
2026-02-27T12:08:23.8871230Z src/swt.c:174:16: error: unused variable ‘ratiomax’ [-Werror=unused-variable]
2026-02-27T12:08:23.8874226Z   174 |   float ratio, ratiomax;        /*ratio: outline length / Area */
2026-02-27T12:08:23.8876402Z       |                ^~~~~~~~
2026-02-27T12:08:23.8878588Z src/swt.c:170:7: error: unused variable ‘a’ [-Werror=unused-variable]
2026-02-27T12:08:23.8881281Z   170 |   int a,b,c,d,e,f,h,i,j,k,l,m;          /*loop variables*/
2026-02-27T12:08:23.8883277Z       |       ^
2026-02-27T12:08:23.8885018Z src/swt.c: In function ‘ReadData’:
2026-02-27T12:08:23.8887430Z src/swt.c:903:42: error: unused variable ‘column4’ [-Werror=unused-variable]
2026-02-27T12:08:23.8889943Z   903 |         float column1, column2, column3, column4;
2026-02-27T12:08:23.8891956Z       |                                          ^~~~~~~
2026-02-27T12:08:23.8894765Z src/swt.c:903:33: error: unused variable ‘column3’ [-Werror=unused-variable]
2026-02-27T12:08:23.8897410Z   903 |         float column1, column2, column3, column4;
2026-02-27T12:08:23.8899319Z       |                                 ^~~~~~~
2026-02-27T12:08:23.8901176Z src/swt.c: In function ‘wavelet’:
2026-02-27T12:08:23.8903421Z src/swt.c:961:34: error: unused variable ‘q’ [-Werror=unused-variable]
2026-02-27T12:08:23.8906193Z   961 |         int i, j, k, l, m, n, p, q, r;                  /*loop variable*/
2026-02-27T12:08:23.8908292Z       |                                  ^
2026-02-27T12:08:23.8910583Z src/swt.c:961:28: error: unused variable ‘n’ [-Werror=unused-variable]
2026-02-27T12:08:23.8913542Z   961 |         int i, j, k, l, m, n, p, q, r;                  /*loop variable*/
2026-02-27T12:08:23.8915868Z       |                            ^
2026-02-27T12:08:23.8918074Z src/swt.c:961:25: error: unused variable ‘m’ [-Werror=unused-variable]
2026-02-27T12:08:23.8920596Z   961 |         int i, j, k, l, m, n, p, q, r;                  /*loop variable*/
2026-02-27T12:08:23.8922723Z       |                         ^
2026-02-27T12:08:23.8925307Z src/swt.c:961:19: error: unused variable ‘k’ [-Werror=unused-variable]
2026-02-27T12:08:23.8928088Z   961 |         int i, j, k, l, m, n, p, q, r;                  /*loop variable*/
2026-02-27T12:08:23.8930230Z       |                   ^
2026-02-27T12:08:23.8948953Z src/swt.c: In function ‘wavInterpComb’:
2026-02-27T12:08:23.8955938Z src/swt.c:1413:16: error: unused variable ‘ratiomax’ [-Werror=unused-variable]
2026-02-27T12:08:23.8959060Z  1413 |   float ratio, ratiomax;        /*ratio: outline length / Area */
2026-02-27T12:08:23.8961303Z       |                ^~~~~~~~
2026-02-27T12:08:23.8963067Z src/swt.c: In function ‘wavInterpCombii’:
2026-02-27T12:08:23.8969589Z src/swt.c:1577:9: error: unused variable ‘percent’ [-Werror=unused-variable]
2026-02-27T12:08:23.8971875Z  1577 |   float percent;
2026-02-27T12:08:23.8973215Z       |         ^~~~~~~
2026-02-27T12:08:23.8979011Z src/swt.c:1575:9: error: unused variable ‘PairScaleFactor’ [-Werror=unused-variable]
2026-02-27T12:08:23.8982761Z  1575 |   float PairScaleFactor;    /*difference in the scales between 2 coefficients*/
2026-02-27T12:08:23.8985443Z       |         ^~~~~~~~~~~~~~~
2026-02-27T12:08:23.8989566Z src/swt.c:1574:7: error: unused variable ‘PSFlogic’ [-Werror=unused-variable]
2026-02-27T12:08:23.8992429Z  1574 |   int PSFlogic, Rlogic;     /*whether or not the scales interract*/
2026-02-27T12:08:23.8994749Z       |       ^~~~~~~~
2026-02-27T12:08:23.8999340Z src/swt.c:1564:22: error: unused variable ‘h’ [-Werror=unused-variable]
2026-02-27T12:08:23.9001754Z  1564 |   int a,b,c,d,e,f,g, h;         /*loop variables*/
2026-02-27T12:08:23.9003621Z       |                      ^
2026-02-27T12:08:23.9008849Z src/swt.c:1564:19: error: unused variable ‘g’ [-Werror=unused-variable]
2026-02-27T12:08:23.9011242Z  1564 |   int a,b,c,d,e,f,g, h;         /*loop variables*/
2026-02-27T12:08:23.9013030Z       |                   ^
2026-02-27T12:08:23.9018467Z src/swt.c:1564:17: error: unused variable ‘f’ [-Werror=unused-variable]
2026-02-27T12:08:23.9020682Z  1564 |   int a,b,c,d,e,f,g, h;         /*loop variables*/
2026-02-27T12:08:23.9021818Z       |                 ^
2026-02-27T12:08:24.0507265Z cc1: all warnings being treated as errors
2026-02-27T12:08:24.0529269Z make: *** [Makefile:22: src/swt.o] Error 1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions