[root@localhost asterisk-18.21.0]# make
[CC] chan_iax2.c → chan_iax2.o
chan_iax2.c:418:64: error: expected ‘;’, ‘,’ or ‘)’ before ‘buf’
static char *auth_method_names(int authmethods, char *restrict buf)
^
chan_iax2.c: In function ‘socket_process_helper’:
chan_iax2.c:11533:8: warning: implicit declaration of function ‘auth_method_names’ [-Wimplicit-function-declaration]
ast_verb(3, “Accepting AUTHENTICATED call from %s:\n”
^
chan_iax2.c:11533:8: warning: format ‘%s’ expects argument of type ‘char *’, but argument 8 has type ‘int’ [-Wformat=]
make[1]: *** [chan_iax2.o] Error 1
make: *** [channels] Error 2
It looks like gcc versions <= 4.9.4 default to supporting -std=gnu90 but the restrict keyword was added in gnu99 which gcc didn’t default to until version 5.5. To get around this, you can add the -std=gnu99 flag to your ./configure command line and it should compile fine with gcc 4.8.