On 07/05/2021 11:12, Joe Orton wrote:
On Tue, May 04, 2021 at 09:12:04AM +0200, jean-frederic clere wrote:
On 04/05/2021 08:59, jean-frederic clere wrote:
...
In file included from htcacheclean.c:36:
htcacheclean.c: In function ‘process_dir’:
/home/jfclere/APR-1.7.x/include/apr-1/apr_ring.h:183:37: error: array
subscript ‘struct _direntry[0]’ is partly outside array bounds of
‘struct <anonymous>[1]’ [-Werror=array-bounds]
    183 | #define APR_RING_PREV(ep, link) (ep)->link.prev
        |                                     ^~
/home/jfclere/APR-1.7.x/include/apr-1/apr_ring.h:230:38: note: in
expansion of macro ‘APR_RING_PREV’
    230 |         APR_RING_PREV((ep1), link) = APR_RING_PREV((lep),
link);        \
        |
+++

Before looking more closely to the problem I have a question, trunk
should be building with apr 1.7.x and apr-util 1.6.x correct?

I used to build with apr 1.6.x and apr-util 1.6.x but something looks
broken now.

Or is that a regression in gcc on fedora34? :-(

It seems to be new with GCC 11, these are warnings which become errors
you since are using --enable-maintainer-mode.

Correct that is the problem: Fedora34 updated gcc.

I have reported a bz:
https://bugzilla.redhat.com/show_bug.cgi?id=1957353

I will close it with a link to the fix once you commit the fix ;-)



The extensive use of APR_RING* is warning-free in all the APR bucket
brigade code even with GCC 11, it is the different way the ring API is
used in both htcacheclean and event/simple which which is triggering
warnings here.

In both case we have an APR_RING_ENTRY declared outside of the structure
which they are embedded in.  Perhaps this is one of the implications
warned about in apr_ring.h:

https://svn.apache.org/viewvc/apr/apr/trunk/include/apr_ring.h?revision=1074876&view=markup#l65

It seems trivial to fix the warning by using the link as embedded in the
structure (attached), though I haven't tested this.

Tested. +1 to merge it ;-)


Regards, Joe




--
Cheers

Jean-Frederic

Reply via email to