AllStarLink / app_rpt

Refactoring and upgrade of AllStarLink's app_rpt, etc.
5 stars 4 forks source link

Compiler Warnings on Debian 12 #222

Closed KB4MDD closed 11 months ago

KB4MDD commented 11 months ago

I am seeing this warnings using gcc (Debian 12.2.0-14) 12.2.0

   [CCi] chan_usbradio.i -> chan_usbradio.o
In file included from chan_usbradio.c:4646:
./xpmr/xpmr.c: In function ‘PmrRx’:
./xpmr/xpmr.c:2698:20: warning: the comparison will always evaluate as ‘true’ for the address of ‘buffer’ will never be NULL [-Waddress]
 2698 |                 if(pChan->sdbg->buffer)
      |                    ^~~~~
In file included from chan_usbradio.c:89:
./xpmr/xpmr.h:316:17: note: ‘buffer’ declared here
  316 |         i16 buffer[16 * SAMPLES_PER_BLOCK];  // allocate for rx and tx
      |                 ^~~~~~
In file included from chan_usbradio.c:4646:
./xpmr/xpmr.c: In function ‘PmrRx’:
./xpmr/xpmr.c:2698:20: warning: the comparison will always evaluate as ‘true’ for the address of ‘buffer’ will never be NULL [-Waddress]
 2698 |                 if(pChan->sdbg->buffer)
      |                    ^~~~~
In file included from chan_usbradio.c:89:
./xpmr/xpmr.h:316:17: note: ‘buffer’ declared here
  316 |         i16 buffer[16 * SAMPLES_PER_BLOCK];  // allocate for rx and tx
      |                 ^~~~~~
[CCi] chan_voter.i -> chan_voter.o
In file included from chan_voter.c:3186:
xpmr/xpmr.c: In function ‘PmrRx’:
xpmr/xpmr.c:2698:20: warning: the comparison will always evaluate as ‘true’ for the address of ‘buffer’ will never be NULL [-Waddress]
2698 | if(pChan->sdbg->buffer)
| ^~~~~
In file included from chan_voter.c:259:
xpmr/xpmr.h:316:17: note: ‘buffer’ declared here
316 | i16 buffer[16 * SAMPLES_PER_BLOCK]; // allocate for rx and tx
| ^~~~~~
In file included from chan_voter.c:3186:
xpmr/xpmr.c: In function ‘PmrRx’:
xpmr/xpmr.c:2698:20: warning: the comparison will always evaluate as ‘true’ for the address of ‘buffer’ will never be NULL [-Waddress]
2698 | if(pChan->sdbg->buffer)
| ^~~~~
In file included from chan_voter.c:259:
xpmr/xpmr.h:316:17: note: ‘buffer’ declared here
316 | i16 buffer[16 * SAMPLES_PER_BLOCK]; // allocate for rx and tx
| ^~~~~~
[CCi] app_rpt/rpt_telemetry.i -> app_rpt/rpt_telemetry.o
app_rpt/rpt_telemetry.c: In function ‘rpt_tele_thread’:
app_rpt/rpt_telemetry.c:2234:21: warning: the comparison will always evaluate as ‘true’ for the address of ‘lastnodewhichkeyedusup’ will never be NULL [-Waddress]
2234 | if (myrpt->lastnodewhichkeyedusup) {
| ^~~~~
In file included from app_rpt/rpt_telemetry.c:18:
app_rpt/app_rpt.h:803:17: note: ‘lastnodewhichkeyedusup’ declared here
803 | char lastnodewhichkeyedusup[MAXNODESTR];
| ^~~~~~~~~~~~~~~~~~~~~~
app_rpt/rpt_telemetry.c:2512:29: warning: the comparison will always evaluate as ‘true’ for the address of ‘param’ will never be NULL [-Waddress]
2512 | if (mytele->param) {
| ^~~~~~
app_rpt/app_rpt.h:452:14: note: ‘param’ declared here
452 | char param[TELEPARAMSIZE];
| ^~~~~
app_rpt/rpt_telemetry.c:2522:21: warning: the comparison will always evaluate as ‘true’ for the address of ‘param’ will never be NULL [-Waddress]
2522 | if (mytele->param) {
| ^~~~~~
app_rpt/app_rpt.h:452:14: note: ‘param’ declared here
452 | char param[TELEPARAMSIZE];
| ^~~~~
app_rpt/rpt_telemetry.c: In function ‘rpt_tele_thread’:
app_rpt/rpt_telemetry.c:2234:21: warning: the comparison will always evaluate as ‘true’ for the address of ‘lastnodewhichkeyedusup’ will never be NULL [-Waddress]
2234 | if (myrpt->lastnodewhichkeyedusup) {
| ^~~~~
In file included from app_rpt/rpt_telemetry.c:18:
app_rpt/app_rpt.h:803:17: note: ‘lastnodewhichkeyedusup’ declared here
803 | char lastnodewhichkeyedusup[MAXNODESTR];
| ^~~~~~~~~~~~~~~~~~~~~~
app_rpt/rpt_telemetry.c:2512:29: warning: the comparison will always evaluate as ‘true’ for the address of ‘param’ will never be NULL [-Waddress]
2512 | if (mytele->param) {
| ^~~~~~
app_rpt/app_rpt.h:452:14: note: ‘param’ declared here
452 | char param[TELEPARAMSIZE];
| ^~~~~
app_rpt/rpt_telemetry.c:2522:21: warning: the comparison will always evaluate as ‘true’ for the address of ‘param’ will never be NULL [-Waddress]
2522 | if (mytele->param) {
| ^~~~~~
app_rpt/app_rpt.h:452:14: note: ‘param’ declared here
452 | char param[TELEPARAMSIZE];
| ^~~~~

There were two warnings that were addressed when I fixed the problem in #191.

The compile completed ok.

InterLinked1 commented 11 months ago

Thanks for reporting, I was fixing some gcc 12 issues this weekend with something else as well. Are you already working on this? Otherwise I will push a fix today. We can assign the issue so we aren't both working on the same things.

KB4MDD commented 11 months ago

I will defer this to you. This may be related to #220.