drowe67 / codec2

Open source speech codec designed for communications quality speech between 700 and 3200 bit/s. The main application is low bandwidth HF/VHF digital radio.
GNU Lesser General Public License v2.1
201 stars 32 forks source link

Embedded Codec2 warnings #41

Open tmiw opened 8 months ago

tmiw commented 8 months ago

I see the following compiler warnings when compiling ezDV:

[1221/1349] Building C object _deps/codec2-build/src/CMakeFiles/codec2.dir/fmfsk.c.obj
/Users/mooneer/ezDV/firmware/build/_deps/codec2-src/src/fmfsk.c: In function 'fmfsk_demod':
/Users/mooneer/ezDV/firmware/build/_deps/codec2-src/src/fmfsk.c:186:9: warning: unused variable 'eye_max' [-Wunused-variable]
  186 |   float eye_max;
      |         ^~~~~~~
/Users/mooneer/ezDV/firmware/build/_deps/codec2-src/src/fmfsk.c:185:7: warning: unused variable 'neyeoffset' [-Wunused-variable]
  185 |   int neyeoffset;
      |       ^~~~~~~~~~
/Users/mooneer/ezDV/firmware/build/_deps/codec2-src/src/fmfsk.c:184:7: warning: unused variable 'neyesamp' [-Wunused-variable]
  184 |   int neyesamp;
      |       ^~~~~~~~
/Users/mooneer/ezDV/firmware/build/_deps/codec2-src/src/fmfsk.c:165:13: warning: unused variable 'k' [-Wunused-variable]
  165 |   int i, j, k;
      |             ^
[1229/1349] Building C object _deps/codec2-build/src/CMakeFiles/codec2.dir/dump.c.obj
/Users/mooneer/ezDV/firmware/build/_deps/codec2-src/src/dump.c: In function 'dump_Sn':
/Users/mooneer/ezDV/firmware/build/_deps/codec2-src/src/dump.c:124:60: warning: implicit conversion from 'float' to 'double' when passing argument to function [-Wdouble-promotion]
  124 |   for (i = 0; i < m_pitch / 2; i++) fprintf(fsn, "%f\t", Sn[i]);
      |                                                          ~~^~~
/Users/mooneer/ezDV/firmware/build/_deps/codec2-src/src/dump.c:126:66: warning: implicit conversion from 'float' to 'double' when passing argument to function [-Wdouble-promotion]
  126 |   for (i = m_pitch / 2; i < m_pitch; i++) fprintf(fsn, "%f\t", Sn[i]);
      |                                                                ~~^~~
/Users/mooneer/ezDV/firmware/build/_deps/codec2-src/src/dump.c: In function 'dump_Sw':
/Users/mooneer/ezDV/firmware/build/_deps/codec2-src/src/dump.c:144:18: warning: implicit conversion from 'float' to 'double' to match other operand of binary expression [-Wdouble-promotion]
  144 |             10.0 * log10(Sw[i].real * Sw[i].real + Sw[i].imag * Sw[i].imag));
      |                  ^
/Users/mooneer/ezDV/firmware/build/_deps/codec2-src/src/dump.c: In function 'dump_Sw_':
/Users/mooneer/ezDV/firmware/build/_deps/codec2-src/src/dump.c:163:14: warning: implicit conversion from 'float' to 'double' to match other operand of binary expression [-Wdouble-promotion]
  163 |         10.0 * log10(Sw_[i].real * Sw_[i].real + Sw_[i].imag * Sw_[i].imag));
      |              ^
/Users/mooneer/ezDV/firmware/build/_deps/codec2-src/src/dump.c: In function 'dump_Ew':
/Users/mooneer/ezDV/firmware/build/_deps/codec2-src/src/dump.c:181:18: warning: implicit conversion from 'float' to 'double' to match other operand of binary expression [-Wdouble-promotion]
  181 |             10.0 * log10(Ew[i].real * Ew[i].real + Ew[i].imag * Ew[i].imag));
      |                  ^
/Users/mooneer/ezDV/firmware/build/_deps/codec2-src/src/dump.c: In function 'dump_softdec':
/Users/mooneer/ezDV/firmware/build/_deps/codec2-src/src/dump.c:197:60: warning: implicit conversion from 'float' to 'double' when passing argument to function [-Wdouble-promotion]
  197 |   for (i = 0; i < n; i++) fprintf(fsoftdec, "%f\t", softdec[i]);
      |                                                     ~~~~~~~^~~
/Users/mooneer/ezDV/firmware/build/_deps/codec2-src/src/dump.c: In function 'dump_model':
/Users/mooneer/ezDV/firmware/build/_deps/codec2-src/src/dump.c:214:36: warning: implicit conversion from 'float' to 'double' when passing argument to function [-Wdouble-promotion]
  214 |   sprintf(line, "%12f %12d ", model->Wo, model->L);
      |                               ~~~~~^~~~
/Users/mooneer/ezDV/firmware/build/_deps/codec2-src/src/dump.c:216:33: warning: implicit conversion from 'float' to 'double' when passing argument to function [-Wdouble-promotion]
  216 |     sprintf(s, "%12f ", model->A[l]);
      |                         ~~~~~~~~^~~
/Users/mooneer/ezDV/firmware/build/_deps/codec2-src/src/dump.c:221:25: warning: implicit conversion from 'float' to 'double' when passing argument to function [-Wdouble-promotion]
  221 |     sprintf(s, "%12f ", 0.0);
      |                         ^~~
/Users/mooneer/ezDV/firmware/build/_deps/codec2-src/src/dump.c: In function 'dump_quantised_model':
/Users/mooneer/ezDV/firmware/build/_deps/codec2-src/src/dump.c:244:36: warning: implicit conversion from 'float' to 'double' when passing argument to function [-Wdouble-promotion]
  244 |   sprintf(line, "%12f %12d ", model->Wo, model->L);
      |                               ~~~~~^~~~
/Users/mooneer/ezDV/firmware/build/_deps/codec2-src/src/dump.c:246:33: warning: implicit conversion from 'float' to 'double' when passing argument to function [-Wdouble-promotion]
  246 |     sprintf(s, "%12f ", model->A[l]);
      |                         ~~~~~~~~^~~
/Users/mooneer/ezDV/firmware/build/_deps/codec2-src/src/dump.c:251:25: warning: implicit conversion from 'float' to 'double' when passing argument to function [-Wdouble-promotion]
  251 |     sprintf(s, "%12f ", 0.0);
      |                         ^~~
/Users/mooneer/ezDV/firmware/build/_deps/codec2-src/src/dump.c: In function 'dump_phase':
/Users/mooneer/ezDV/firmware/build/_deps/codec2-src/src/dump.c:273:57: warning: implicit conversion from 'float' to 'double' when passing argument to function [-Wdouble-promotion]
  273 |   for (l = 1; l <= L; l++) fprintf(fphase, "%f\t", phase[l]);
      |                                                    ~~~~~^~~
/Users/mooneer/ezDV/firmware/build/_deps/codec2-src/src/dump.c:274:62: warning: implicit conversion from 'float' to 'double' when passing argument to function [-Wdouble-promotion]
  274 |   for (l = L + 1; l <= MAX_AMP; l++) fprintf(fphase, "%f\t", 0.0);
      |                                                              ^~~
/Users/mooneer/ezDV/firmware/build/_deps/codec2-src/src/dump.c: In function 'dump_phase_':
/Users/mooneer/ezDV/firmware/build/_deps/codec2-src/src/dump.c:290:59: warning: implicit conversion from 'float' to 'double' when passing argument to function [-Wdouble-promotion]
  290 |   for (l = 1; l <= L; l++) fprintf(fphase_, "%f\t", phase_[l]);
      |                                                     ~~~~~~^~~
/Users/mooneer/ezDV/firmware/build/_deps/codec2-src/src/dump.c:291:62: warning: implicit conversion from 'float' to 'double' when passing argument to function [-Wdouble-promotion]
  291 |   for (l = L + 1; l < MAX_AMP; l++) fprintf(fphase_, "%f\t", 0.0);
      |                                                              ^~~
/Users/mooneer/ezDV/firmware/build/_deps/codec2-src/src/dump.c: In function 'dump_snr':
/Users/mooneer/ezDV/firmware/build/_deps/codec2-src/src/dump.c:322:25: warning: implicit conversion from 'float' to 'double' when passing argument to function [-Wdouble-promotion]
  322 |   fprintf(fsnr, "%f\n", snr);
      |                         ^~~
/Users/mooneer/ezDV/firmware/build/_deps/codec2-src/src/dump.c: In function 'dump_lpc_snr':
/Users/mooneer/ezDV/firmware/build/_deps/codec2-src/src/dump.c:336:28: warning: implicit conversion from 'float' to 'double' when passing argument to function [-Wdouble-promotion]
  336 |   fprintf(flpcsnr, "%f\n", snr);
      |                            ^~~
/Users/mooneer/ezDV/firmware/build/_deps/codec2-src/src/dump.c: In function 'dump_Pwb':
/Users/mooneer/ezDV/firmware/build/_deps/codec2-src/src/dump.c:353:62: warning: implicit conversion from 'float' to 'double' when passing argument to function [-Wdouble-promotion]
  353 |   for (i = 0; i < FFT_ENC / 2; i++) fprintf(fpwb, "%f\t", Pwb[i]);
      |                                                           ~~~^~~
/Users/mooneer/ezDV/firmware/build/_deps/codec2-src/src/dump.c: In function 'dump_Pw':
/Users/mooneer/ezDV/firmware/build/_deps/codec2-src/src/dump.c:369:60: warning: implicit conversion from 'float' to 'double' when passing argument to function [-Wdouble-promotion]
  369 |   for (i = 0; i < FFT_ENC / 2; i++) fprintf(fpw, "%f\t", Pw[i]);
      |                                                          ~~^~~
/Users/mooneer/ezDV/firmware/build/_deps/codec2-src/src/dump.c: In function 'dump_Rw':
/Users/mooneer/ezDV/firmware/build/_deps/codec2-src/src/dump.c:385:60: warning: implicit conversion from 'float' to 'double' when passing argument to function [-Wdouble-promotion]
  385 |   for (i = 0; i < FFT_ENC / 2; i++) fprintf(frw, "%f\t", Rw[i]);
      |                                                          ~~^~~
/Users/mooneer/ezDV/firmware/build/_deps/codec2-src/src/dump.c: In function 'dump_weights':
/Users/mooneer/ezDV/firmware/build/_deps/codec2-src/src/dump.c:401:58: warning: implicit conversion from 'float' to 'double' when passing argument to function [-Wdouble-promotion]
  401 |   for (i = 0; i < order; i++) fprintf(fweights, "%f\t", w[i]);
      |                                                         ~^~~
/Users/mooneer/ezDV/firmware/build/_deps/codec2-src/src/dump.c: In function 'dump_lsp':
/Users/mooneer/ezDV/firmware/build/_deps/codec2-src/src/dump.c:417:53: warning: implicit conversion from 'float' to 'double' when passing argument to function [-Wdouble-promotion]
  417 |   for (i = 0; i < 10; i++) fprintf(flsp, "%f\t", lsp[i]);
      |                                                  ~~~^~~
/Users/mooneer/ezDV/firmware/build/_deps/codec2-src/src/dump.c: In function 'dump_lsp_':
/Users/mooneer/ezDV/firmware/build/_deps/codec2-src/src/dump.c:433:55: warning: implicit conversion from 'float' to 'double' when passing argument to function [-Wdouble-promotion]
  433 |   for (i = 0; i < 10; i++) fprintf(flsp_, "%f\t", lsp_[i]);
      |                                                   ~~~~^~~
/Users/mooneer/ezDV/firmware/build/_deps/codec2-src/src/dump.c: In function 'dump_mel':
/Users/mooneer/ezDV/firmware/build/_deps/codec2-src/src/dump.c:449:56: warning: implicit conversion from 'float' to 'double' when passing argument to function [-Wdouble-promotion]
  449 |   for (i = 0; i < order; i++) fprintf(fmel, "%f\t", mel[i]);
      |                                                     ~~~^~~
/Users/mooneer/ezDV/firmware/build/_deps/codec2-src/src/dump.c: In function 'dump_ak':
/Users/mooneer/ezDV/firmware/build/_deps/codec2-src/src/dump.c:481:55: warning: implicit conversion from 'float' to 'double' when passing argument to function [-Wdouble-promotion]
  481 |   for (i = 0; i <= order; i++) fprintf(fak, "%f\t", ak[i]);
      |                                                     ~~^~~
/Users/mooneer/ezDV/firmware/build/_deps/codec2-src/src/dump.c: In function 'dump_ak_':
/Users/mooneer/ezDV/firmware/build/_deps/codec2-src/src/dump.c:497:57: warning: implicit conversion from 'float' to 'double' when passing argument to function [-Wdouble-promotion]
  497 |   for (i = 0; i <= order; i++) fprintf(fak_, "%f\t", ak_[i]);
      |                                                      ~~~^~~
/Users/mooneer/ezDV/firmware/build/_deps/codec2-src/src/dump.c: In function 'dump_Fw':
/Users/mooneer/ezDV/firmware/build/_deps/codec2-src/src/dump.c:513:55: warning: implicit conversion from 'float' to 'double' when passing argument to function [-Wdouble-promotion]
  513 |   for (i = 0; i < 256; i++) fprintf(ffw, "%f\t", Fw[i].real);
      |                                                  ~~~~~^~~~~
/Users/mooneer/ezDV/firmware/build/_deps/codec2-src/src/dump.c: In function 'dump_e':
/Users/mooneer/ezDV/firmware/build/_deps/codec2-src/src/dump.c:529:57: warning: implicit conversion from 'float' to 'double' when passing argument to function [-Wdouble-promotion]
  529 |   for (i = 0; i < 500 / 2; i++) fprintf(fe, "%f\t", e_hz[i]);
      |                                                     ~~~~^~~
/Users/mooneer/ezDV/firmware/build/_deps/codec2-src/src/dump.c:531:59: warning: implicit conversion from 'float' to 'double' when passing argument to function [-Wdouble-promotion]
  531 |   for (i = 500 / 2; i < 500; i++) fprintf(fe, "%f\t", e_hz[i]);
      |                                                       ~~~~^~~
/Users/mooneer/ezDV/firmware/build/_deps/codec2-src/src/dump.c: In function 'dump_sq':
/Users/mooneer/ezDV/firmware/build/_deps/codec2-src/src/dump.c:547:60: warning: implicit conversion from 'float' to 'double' when passing argument to function [-Wdouble-promotion]
  547 |   for (i = 0; i < m_pitch / 2; i++) fprintf(fsq, "%f\t", sq[i]);
      |                                                          ~~^~~
/Users/mooneer/ezDV/firmware/build/_deps/codec2-src/src/dump.c:549:66: warning: implicit conversion from 'float' to 'double' when passing argument to function [-Wdouble-promotion]
  549 |   for (i = m_pitch / 2; i < m_pitch; i++) fprintf(fsq, "%f\t", sq[i]);
      |                                                                ~~^~~
/Users/mooneer/ezDV/firmware/build/_deps/codec2-src/src/dump.c: In function 'dump_dec':
/Users/mooneer/ezDV/firmware/build/_deps/codec2-src/src/dump.c:565:60: warning: implicit conversion from 'float' to 'double' when passing argument to function [-Wdouble-promotion]
  565 |   for (i = 0; i < 320 / 5; i++) fprintf(fdec, "%f\t", Fw[i].real);
      |                                                       ~~~~~^~~~~
/Users/mooneer/ezDV/firmware/build/_deps/codec2-src/src/dump.c: In function 'dump_bg':
/Users/mooneer/ezDV/firmware/build/_deps/codec2-src/src/dump.c:580:32: warning: implicit conversion from 'float' to 'double' when passing argument to function [-Wdouble-promotion]
  580 |   fprintf(fbg, "%f\t%f\t%f\n", e, bg_est, percent_uv);
      |                                ^
/Users/mooneer/ezDV/firmware/build/_deps/codec2-src/src/dump.c:580:35: warning: implicit conversion from 'float' to 'double' when passing argument to function [-Wdouble-promotion]
  580 |   fprintf(fbg, "%f\t%f\t%f\n", e, bg_est, percent_uv);
      |                                   ^~~~~~
/Users/mooneer/ezDV/firmware/build/_deps/codec2-src/src/dump.c:580:43: warning: implicit conversion from 'float' to 'double' when passing argument to function [-Wdouble-promotion]
  580 |   fprintf(fbg, "%f\t%f\t%f\n", e, bg_est, percent_uv);
      |                                           ^~~~~~~~~~
/Users/mooneer/ezDV/firmware/build/_deps/codec2-src/src/dump.c: In function 'dump_E':
/Users/mooneer/ezDV/firmware/build/_deps/codec2-src/src/dump.c:594:28: warning: implicit conversion from 'float' to 'double' to match other operand of binary expression [-Wdouble-promotion]
  594 |   fprintf(fE, "%f\n", 10.0 * log10(E));
      |                            ^
[1234/1349] Building C object _deps/codec2-build/src/CMakeFiles/codec2.dir/fsk.c.obj
/Users/mooneer/ezDV/firmware/build/_deps/codec2-src/src/fsk.c: In function 'fsk_demod_core':
/Users/mooneer/ezDV/firmware/build/_deps/codec2-src/src/fsk.c:643:17: warning: unused variable 'neyeoffset' [-Wunused-variable]
  643 |   int neyesamp, neyeoffset;
      |                 ^~~~~~~~~~
/Users/mooneer/ezDV/firmware/build/_deps/codec2-src/src/fsk.c:643:7: warning: unused variable 'neyesamp' [-Wunused-variable]
  643 |   int neyesamp, neyeoffset;
      |       ^~~~~~~~
/Users/mooneer/ezDV/firmware/build/_deps/codec2-src/src/fsk.c:642:28: warning: unused variable 'eye_max' [-Wunused-variable]
  642 |   float meanebno, stdebno, eye_max;
      |                            ^~~~~~~
/Users/mooneer/ezDV/firmware/build/_deps/codec2-src/src/fsk.c: In function 'stats_init':
/Users/mooneer/ezDV/firmware/build/_deps/codec2-src/src/fsk.c:968:7: warning: unused variable 'M' [-Wunused-variable]
  968 |   int M = fsk->mode;
      |       ^
/Users/mooneer/ezDV/firmware/build/_deps/codec2-src/src/fsk.c:967:7: warning: unused variable 'P' [-Wunused-variable]
  967 |   int P = fsk->P;
      |       ^
/Users/mooneer/ezDV/firmware/build/_deps/codec2-src/src/fsk.c:966:13: warning: unused variable 'm' [-Wunused-variable]
  966 |   int i, j, m;
      |             ^
/Users/mooneer/ezDV/firmware/build/_deps/codec2-src/src/fsk.c:966:10: warning: unused variable 'j' [-Wunused-variable]
  966 |   int i, j, m;
      |          ^
/Users/mooneer/ezDV/firmware/build/_deps/codec2-src/src/fsk.c:966:7: warning: unused variable 'i' [-Wunused-variable]
  966 |   int i, j, m;
      |       ^
[1250/1349] Building C object _deps/codec2-build/src/CMakeFiles/codec2.dir/modem_stats.c.obj
/Users/mooneer/ezDV/firmware/build/_deps/codec2-src/src/modem_stats.c: In function 'modem_stats_open':
/Users/mooneer/ezDV/firmware/build/_deps/codec2-src/src/modem_stats.c:37:7: warning: unused variable 'i' [-Wunused-variable]
   37 |   int i;
      |       ^
[1270/1349] Building C object _deps/codec2-build/src/CMakeFiles/codec2.dir/lpcnet_freq.c.obj
/Users/mooneer/ezDV/firmware/build/_deps/codec2-src/src/lpcnet_freq.c: In function 'lpcnet_compute_band_energy':
/Users/mooneer/ezDV/firmware/build/_deps/codec2-src/src/lpcnet_freq.c:92:21: warning: implicit conversion from 'float' to 'double' to match other operand of binary expression [-Wdouble-promotion]
   92 |     bandE[i] = 10.0 * log10(sum[i]);
      |                     ^
[1271/1349] Building C object _deps/codec2-build/src/CMakeFiles/codec2.dir/ldpc_codes.c.obj
/Users/mooneer/ezDV/firmware/build/_deps/codec2-src/src/ldpc_codes.c:34:6: warning: missing initializer for field 'ldpc_data_bits_per_frame' of 'struct LDPC' [-Wmissing-field-initializers]
   34 |      (uint16_t *)HRA_112_112_H_rows, (uint16_t *)HRA_112_112_H_cols},
      |      ^
In file included from /Users/mooneer/ezDV/firmware/build/_deps/codec2-src/src/ldpc_codes.h:15,
                 from /Users/mooneer/ezDV/firmware/build/_deps/codec2-src/src/ldpc_codes.c:9:
/Users/mooneer/ezDV/firmware/build/_deps/codec2-src/src/mpdecode_core.h:34:7: note: 'ldpc_data_bits_per_frame' declared here
   34 |   int ldpc_data_bits_per_frame;
      |       ^~~~~~~~~~~~~~~~~~~~~~~~
/Users/mooneer/ezDV/firmware/build/_deps/codec2-src/src/ldpc_codes.c:39:6: warning: missing initializer for field 'ldpc_data_bits_per_frame' of 'struct LDPC' [-Wmissing-field-initializers]
   39 |      (uint16_t *)HRA_56_56_H_rows, (uint16_t *)HRA_56_56_H_cols},
      |      ^
/Users/mooneer/ezDV/firmware/build/_deps/codec2-src/src/mpdecode_core.h:34:7: note: 'ldpc_data_bits_per_frame' declared here
   34 |   int ldpc_data_bits_per_frame;
      |       ^~~~~~~~~~~~~~~~~~~~~~~~

This is likely due to compiling a couple of files that aren't necessary for 700D/E/1600 support (the SM1000 build explicitly enumerates each file brought in from Codec2 instead of just using CMake's project include functionality, so no warnings there). No action needed for now, just tracking in case we decide to fix this later.