Make Error Dahdi_Linux

Hello. I am going to make this brief cause its a bit late. I was following the install Asterisk guide for Ubuntu and I got all the way up to make for libpri. For reference here is a list of commands I used.

sudo -s
apt-get update -y
apt-get upgrade -y
apt-get install build-essential git autoconf wget subversion pkg-config libjansson-dev libxml2-dev uuid-dev libsqlite3-dev libtool -y
cd /opt
git clone -b next git://git.asterisk.org/dahdi/linux dahdi-linux
cd dahdi-linux
make
make install
cd /opt
git clone -b next git://git.asterisk.org/dahdi/tools dahdi-tools
cd dahdi-tools
autoreconf -i
./configure
make install
make install-config
dahdi_genconf modules
git clone https://gerrit.asterisk.org/libpri libpri
cd libpri

then this

make install

root@gameserver:/opt/dahdi-tools# cd libpri
root@gameserver:/opt/dahdi-tools/libpri# make
gcc -g -Wall -Werror -Wstrict-prototypes -Wmissing-prototypes -fPIC -O2 -MD -MT q921.o -MF .q921.o.d -MP -c -o q921.o q921.c
q921.c: In function ‘q921_dump’:
q921.c:1333:85: error: array subscript 0 is outside the bounds of an interior zero-length array ‘u_int8_t[0]’ {aka ‘unsigned char’} [-Werror=zero-length-bounds]
1333 | if ((h->u.ft == 3) && (h->u.m3 == 0) && (h->u.m2 == 0) && (h->u.data[0] == 0x0f)) {
| ~^
In file included from pri_internal.h:35,
from q921.c:38:
pri_q921.h:136:18: note: while referencing ‘data’
136 | u_int8_t data[0]; /* Any further data */
| ^
~
q921.c:1338:59: error: array subscript 3 is outside the bounds of an interior zero-length array ‘u_int8_t[0]’ {aka ‘unsigned char[]’} [-Werror=zero-length-bounds]
1338 | type = q921_tei_mgmt2str(h->u.data[3]);
| ~^
In file included from pri_internal.h:35,
from q921.c:38:
pri_q921.h:136:18: note: while referencing ‘data’
136 | u_int8_t data[0]; /* Any further data */
| ^
~
q921.c:1340:40: error: array subscript 1 is outside the bounds of an interior zero-length array ‘u_int8_t[0]’ {aka ‘unsigned char[]’} [-Werror=zero-length-bounds]
1340 | ri = (h->u.data[1] << 8) | h->u.data[2];
| ~^
In file included from pri_internal.h:35,
from q921.c:38:
pri_q921.h:136:18: note: while referencing ‘data’
136 | u_int8_t data[0]; /* Any further data */
| ^
~
q921.c:1340:61: error: array subscript 2 is outside the bounds of an interior zero-length array ‘u_int8_t[0]’ {aka ‘unsigned char[]’} [-Werror=zero-length-bounds]
1340 | ri = (h->u.data[1] << 8) | h->u.data[2];
| ~^
In file included from pri_internal.h:35,
from q921.c:38:
pri_q921.h:136:18: note: while referencing ‘data’
136 | u_int8_t data[0]; /* Any further data */
| ^
~
q921.c:1342:34: error: array subscript 4 is outside the bounds of an interior zero-length array ‘u_int8_t[0]’ {aka ‘unsigned char[]’} [-Werror=zero-length-bounds]
1342 | action = &h->u.data[4];
| ^

In file included from pri_internal.h:35,
from q921.c:38:
pri_q921.h:136:18: note: while referencing ‘data’
136 | u_int8_t data[0]; /* Any further data */
| ^
~
q921.c: In function ‘q921_mdl_send.constprop’:
q921.c:215:16: error: array subscript 0 is outside the bounds of an interior zero-length array ‘u_int8_t[0]’ {aka ‘unsigned char[]’} [-Werror=zero-length-bounds]
215 | f->data[0] = 0x0f; /* Management entity /
| ~~~~~^
In file included from pri_internal.h:35,
from q921.c:38:
pri_q921.h:136:18: note: while referencing ‘data’
136 | u_int8_t data[0]; /
Any further data */
| ^
~
q921.c:216:16: error: array subscript 1 is outside the bounds of an interior zero-length array ‘u_int8_t[0]’ {aka ‘unsigned char’} [-Werror=zero-length-bounds]
216 | f->data[1] = (ri >> 8) & 0xff;
| ~~~^
In file included from pri_internal.h:35,
from q921.c:38:
pri_q921.h:136:18: note: while referencing ‘data’
136 | u_int8_t data[0]; /* Any further data */
| ^
~
q921.c:217:16: error: array subscript 2 is outside the bounds of an interior zero-length array ‘u_int8_t[0]’ {aka ‘unsigned char’} [-Werror=zero-length-bounds]
217 | f->data[2] = ri & 0xff;
| ~~~^
In file included from pri_internal.h:35,
from q921.c:38:
pri_q921.h:136:18: note: while referencing ‘data’
136 | u_int8_t data[0]; /* Any further data */
| ^
~
q921.c:218:16: error: array subscript 3 is outside the bounds of an interior zero-length array ‘u_int8_t[0]’ {aka ‘unsigned char’} [-Werror=zero-length-bounds]
218 | f->data[3] = message;
| ~~~^
In file included from pri_internal.h:35,
from q921.c:38:
pri_q921.h:136:18: note: while referencing ‘data’
136 | u_int8_t data[0]; /* Any further data */
| ^
~
q921.c:219:16: error: array subscript 4 is outside the bounds of an interior zero-length array ‘u_int8_t[0]’ {aka ‘unsigned char’} [-Werror=zero-length-bounds]
219 | f->data[4] = (ai << 1) | 1;
| ~~~^
In file included from pri_internal.h:35,
from q921.c:38:
pri_q921.h:136:18: note: while referencing ‘data’
136 | u_int8_t data[0]; /* Any further data */
| ^
~
q921.c: In function ‘q921_receive’:
q921.c:1501:20: error: array subscript 0 is outside the bounds of an interior zero-length array ‘u_int8_t[0]’ {aka ‘unsigned char’} [-Werror=zero-length-bounds]
1501 | if (h->data[0] != 0x0f) {
| ~~~^
In file included from pri_internal.h:35,
from q921.c:38:
pri_q921.h:136:18: note: while referencing ‘data’
136 | u_int8_t data[0]; /* Any further data */
| ^
~
q921.c:1510:20: error: array subscript 3 is outside the bounds of an interior zero-length array ‘u_int8_t[0]’ {aka ‘unsigned char’} [-Werror=zero-length-bounds]
1510 | if (h->data[3] != Q921_TEI_IDENTITY_CHECK_RESPONSE
| ~^
In file included from pri_internal.h:35,
from q921.c:38:
pri_q921.h:136:18: note: while referencing ‘data’
136 | u_int8_t data[0]; /* Any further data */
| ^
~
q921.c:1511:29: error: array subscript 4 is outside the bounds of an interior zero-length array ‘u_int8_t[0]’ {aka ‘unsigned char[]’} [-Werror=zero-length-bounds]
1511 | && !(h->data[4] & 0x01)) {
| ~^
In file included from pri_internal.h:35,
from q921.c:38:
pri_q921.h:136:18: note: while referencing ‘data’
136 | u_int8_t data[0]; /* Any further data */
| ^
~
q921.c:1528:22: error: array subscript 1 is outside the bounds of an interior zero-length array ‘u_int8_t[0]’ {aka ‘unsigned char[]’} [-Werror=zero-length-bounds]
1528 | ri = (h->data[1] << 8) | h->data[2];
| ~^
In file included from pri_internal.h:35,
from q921.c:38:
pri_q921.h:136:18: note: while referencing ‘data’
136 | u_int8_t data[0]; /* Any further data */
| ^
~
q921.c:1528:41: error: array subscript 2 is outside the bounds of an interior zero-length array ‘u_int8_t[0]’ {aka ‘unsigned char[]’} [-Werror=zero-length-bounds]
1528 | ri = (h->data[1] << 8) | h->data[2];
| ~^
In file included from pri_internal.h:35,
from q921.c:38:
pri_q921.h:136:18: note: while referencing ‘data’
136 | u_int8_t data[0]; /* Any further data */
| ^
~
q921.c:1529:23: error: array subscript 4 is outside the bounds of an interior zero-length array ‘u_int8_t[0]’ {aka ‘unsigned char[]’} [-Werror=zero-length-bounds]
1529 | tei = (h->data[4] >> 1);
| ~^
In file included from pri_internal.h:35,
from q921.c:38:
pri_q921.h:136:18: note: while referencing ‘data’
136 | u_int8_t data[0]; /* Any further data */
| ^
~
q921.c:1531:24: error: array subscript 3 is outside the bounds of an interior zero-length array ‘u_int8_t[0]’ {aka ‘unsigned char[]’} [-Werror=zero-length-bounds]
1531 | switch (h->data[3]) {
| ~^
In file included from pri_internal.h:35,
from q921.c:38:
pri_q921.h:136:18: note: while referencing ‘data’
136 | u_int8_t data[0]; /* Any further data */
| ^
~
q921.c:1606:26: error: array subscript 4 is outside the bounds of an interior zero-length array ‘u_int8_t[0]’ {aka ‘unsigned char[]’} [-Werror=zero-length-bounds]
1606 | action = &h->data[4];
| ^

In file included from pri_internal.h:35,
from q921.c:38:
pri_q921.h:136:18: note: while referencing ‘data’
136 | u_int8_t data[0]; /* Any further data */
| ^
~
cc1: all warnings being treated as errors
make: *** [Makefile:192: q921.o] Error 1
root@gameserver:/opt/dahdi-tools/libpri#

Any idea? Help would be greatly appreciated

Dear ,
May you share the your installation server kernel.

5.15.0-52-g

Dear ,
Kernel 5.xxx not support dahdi software …

You might try Ubuntu 20 and/or the tarballs (not git pulls) from http://downloads.asterisk.org/pub/telephony/dahdi-linux-complete/

This is an issue with LibPRI, not DAHDI Linux.

This issue has been fixed but not merged yet.
Apply the patch here and it should compile: https://gerrit.asterisk.org/c/libpri/+/19311

1 Like