freeswitch icon indicating copy to clipboard operation
freeswitch copied to clipboard

`-Werror=address` shows tautologies in switch_core_media.c and aborts compilation

Open dilyanpalauzov opened this issue 3 years ago • 1 comments

Compiling using GCC 12 fails with:

make  all-recursive
make[1]: Entering directory '/git/freeswitch/freeswitch'
  CC       src/libfreeswitch_la-switch_core_media.lo
src/switch_core_media.c: In function ‘parse_lifetime_mki’:
src/switch_core_media.c:1306:64: error: the comparison will always evaluate as ‘true’ for the pointer operand in ‘field_begin + 2’ must not be NULL [-Werror=address]
 1306 |                         } else if (isdigit(*(field_begin + 1)) && (field_begin + 2) && (*(field_begin + 2) == '^') && (field_begin + 3) && isdigit(*(field_begin + 3))) {
      |                                                                ^~
src/switch_core_media.c:1306:116: error: the comparison will always evaluate as ‘true’ for the pointer operand in ‘field_begin + 3’ must not be NULL [-Werror=address]
 1306 |                         } else if (isdigit(*(field_begin + 1)) && (field_begin + 2) && (*(field_begin + 2) == '^') && (field_begin + 3) && isdigit(*(field_begin + 3))) {
      |                                                                                                                    ^~
cc1: all warnings being treated as errors
make[1]: *** [Makefile:2495: src/libfreeswitch_la-switch_core_media.lo] Error 1
make[1]: Leaving directory '/git/freeswitch/freeswitch'
make: *** [Makefile:1450: all] Error 2

dilyanpalauzov avatar May 26 '22 06:05 dilyanpalauzov

Hi all,

This code was added in commit 1fdd58f533c9b7f4e6ffb93ed3ab0e494908719d by piotrgregor. Maybe somebody knows how to get in touch with him.

Kind regards, Seb

micmac1 avatar Jun 12 '22 15:06 micmac1