codec: add a new macro for unused functions

Variables used only for tracing logs can trigger
-Werror=unusef-variable when tracing is disabled.
This macro helps to silent gcc in those cases
Fix compiler warnings and remove dead code

Fix several -Werror=unused-variable and -Werror=unused-but-set-variable
and removed dead code found with this warnings
Fix -Werror=sign-compare compiler warnings
Fix compiler warning -Werror=maybe-uninitialized
Replace -Werror with -Wall

Treating warnings as error is useless if no warning is activated.
Several build systems enable -Wall in the CLFAGS, which in combination
with -Werror can trigger undesired build errors.