Re: libpri compile ubuntu 22.04

[email protected]
Newsgroups gmane.comp.telephony.pbx.asterisk.user
Message-ID <[email protected]>
On 9/26/2022 8:25 PM, Jerry Geis wrote:
> On Mon, Sep 26, 2022 at 8:09 PM <[email protected] 
> <mailto:[email protected]>> wrote:
>
>     On 9/26/2022 8:00 PM, Jerry Geis wrote:
>     > I am getting a compile error:
>     >
>     > gcc -g  -Wall -Werror -Wstrict-prototypes -Wmissing-prototypes
>     > -Werror=zero-length-bounds -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)) {
>     >        |
>     >         ~~~~~~~~~^~~
>     >
>     > EVEN though I added the "-Werror=zero-length-bounds" to the
>     makefile as you
>     > can see.
>     > How do I get libpri-1.6.0 to compile on Ubuntu 22.04 LTS ?
>     Just informationally, there is an open issue for this[1], but it
>     hasn't
>     been worked on.
>     I am not sure if changing the [0] to [] will do the trick as I
>     haven't
>     been able to look at this yet, but you could try that.
>
>     [1] https://issues.asterisk.org/jira/browse/PRI-189
>
>
> Problem is it references [0], [1], [2], [3], and [4]. Not just [0], so 
> I don't think so.
> Thank you.

[0] is a notation used for flexible array members, placed at the end of 
a struct. It does not actually mean the array is of size 0. It seems 
that [0] may have fallen out of use now in favor of [] which is how it 
is defined in the C99 standard.
I have not tested this in any way whatsoever, but here is a quick 
patch[1] that makes it compile again, that you could try. If you do try 
it, let us know how it works.

[1] https://gerrit.asterisk.org/c/libpri/+/19311

-- 
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
      https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.