Skip to content

Warning flags that could be possibly added

When compiling on my Mac, a few warnings still pop up - probably due to compiler version differences to the CI setup. The additional checks are

  • -Wself-assign, e.g: lib_rend/ivas_objectRenderer_mix.c:844:11: warning: explicitly assigning value of variable of type 'Word16' (aka 'short') to itself [-Wself-assign] j = j;
  • -Wunused-but-set-variable, e.g.: lib_dec/dec_uv_fx.c:49:19: warning: variable 'p_Aq_fx' set but not used [-Wunused-but-set-variable] const Word16 *p_Aq_fx;
  • -Wtautological-pointer-compare, e.g.: lib_rend/lib_rend.c:14780:26: warning: comparison of array 'masa_band_mapping' equal to a null pointer is always false [-Wtautological-pointer-compare] if ( masa_band_mapping == NULL && hDirACRend->synthesisConf == DIRAC_SYNTHESIS_GAIN_SHD )
  • -Wstrict-prototypes, e.g.: lib_com/count.c:412:33: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes] void ClearNbTimeObjectsAreCalled()

Also, when compiling the codec with sanitizers on a gitlab runner machine (e.g. make -j CLANG=1), more warnings show up (due to clang compiler being used then opposed to gcc otherwise):

  • -Wimplicit-const-int-float-conversion, e.g.: lib_rend/ivas_dirac_output_synthesis_dec.c:3229:52: warning: implicit conversion from 'int' to 'float' changes value from 2147483647 to 2147483648 [-Wimplicit-const-int-float-conversion] prevWeight = Mpy_32_32( L_sub( ONE_IN_Q31, DIRECTION_SMOOTHNESS_ALPHA_Q31 ),

I think the first two warnings would make sense to include in the Makefile as this increase readability of the code and remove clutter. Then, the -Wimplicit-const-int-float-conversion warnings should maybe be checked as value changes due to implicit type conversions seem dangerous. The other two warning types are maybe not that important.

Edited by Sandesh Venkatesh