<div dir="ltr">Hi all,<br><div>  that is not just with clang: <a href="https://build.squid-cache.org/job/trunk-amd64-matrix/COMPILER=gcc,CPU=amd64,OS=fedora-rawhide,force_on_docker_arm64=docker-build-host-lowpri/434/console">https://build.squid-cache.org/job/trunk-amd64-matrix/COMPILER=gcc,CPU=amd64,OS=fedora-rawhide,force_on_docker_arm64=docker-build-host-lowpri/434/console</a> shows the error on gcc 13.</div><div><br></div><div>I recall a conversation where Alex showed it to be a compiler issue, but I can't find it now.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Mar 28, 2023 at 2:27 PM Amos Jeffries <<a href="mailto:squid3@treenet.co.nz">squid3@treenet.co.nz</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Alex, since the whole IPC and SHM system is your design are you able to <br>
work on fixing the FlexibleArray build errors we are now getting with <br>
clang v15.<br>
<br>
IIRC FlexibleArray was a placeholder for std::dynarray, which is now <br>
officially dead. So if we can do an implementation which uses more <br>
standard behaviour it would be better.<br>
<br>
Cheers<br>
Amos<br>
<br>
<br>
[1] Log excerpt from Jenkins:<br>
<br>
01:00:06 In file included from ../../../../src/ipc/StoreMap.h:12,<br>
01:00:06                  from ../../../../src/fs/rock/RockRebuild.h:17,<br>
01:00:06                  from ../../../../src/fs/rock/RockRebuild.cc:15:<br>
01:00:06 In member function 'Item& <br>
Ipc::Mem::FlexibleArray<Item>::operator[](int) [with Item = long <br>
unsigned int]',<br>
01:00:06     inlined from 'Ipc::StoreMapItems<C>::Item& <br>
Ipc::StoreMapItems<C>::at(int) [with C = long unsigned int]' at <br>
../../../../src/ipc/StoreMap.h:136:21,<br>
01:00:06     inlined from 'Rock::LoadingEntry::LoadingEntry(sfileno, <br>
Rock::LoadingParts&)' at ../../../../src/fs/rock/RockRebuild.cc:199:27:<br>
01:00:06 ../../../../src/ipc/mem/FlexibleArray.h:34:52: error: array <br>
subscript -1 is below array bounds of 'long unsigned int [1]' <br>
[-Werror=array-bounds=]<br>
01:00:06    34 |     Item &operator [](const int idx) { return items[idx]; }<br>
01:00:06       | ~~~~~^<br>
01:00:06 ../../../../src/ipc/mem/FlexibleArray.h: In constructor <br>
'Rock::LoadingEntry::LoadingEntry(sfileno, Rock::LoadingParts&)':<br>
01:00:06 ../../../../src/ipc/mem/FlexibleArray.h:43:10: note: while <br>
referencing 'Ipc::Mem::FlexibleArray<long unsigned int>::items'<br>
01:00:06    43 |     Item items[1]; // ensures proper alignment of array <br>
elements<br>
01:00:06       |          ^~~~~<br>
01:00:06 In member function 'Item& <br>
Ipc::Mem::FlexibleArray<Item>::operator[](int) [with Item = unsigned int]',<br>
01:00:06     inlined from 'Ipc::StoreMapItems<C>::Item& <br>
Ipc::StoreMapItems<C>::at(int) [with C = unsigned int]' at <br>
../../../../src/ipc/StoreMap.h:136:21,<br>
01:00:06     inlined from 'Rock::LoadingEntry::LoadingEntry(sfileno, <br>
Rock::LoadingParts&)' at ../../../../src/fs/rock/RockRebuild.cc:200:33:<br>
01:00:06 ../../../../src/ipc/mem/FlexibleArray.h:34:52: error: array <br>
subscript -1 is below array bounds of 'unsigned int [1]' <br>
[-Werror=array-bounds=]<br>
01:00:06    34 |     Item &operator [](const int idx) { return items[idx]; }<br>
01:00:06       | ~~~~~^<br>
01:00:06 ../../../../src/ipc/mem/FlexibleArray.h: In constructor <br>
'Rock::LoadingEntry::LoadingEntry(sfileno, Rock::LoadingParts&)':<br>
01:00:06 ../../../../src/ipc/mem/FlexibleArray.h:43:10: note: while <br>
referencing 'Ipc::Mem::FlexibleArray<unsigned int>::items'<br>
01:00:06    43 |     Item items[1]; // ensures proper alignment of array <br>
elements<br>
01:00:06       |          ^~~~~<br>
01:00:06 In member function 'Item& <br>
Ipc::Mem::FlexibleArray<Item>::operator[](int) [with Item = int]',<br>
01:00:06     inlined from 'Ipc::StoreMapItems<C>::Item& <br>
Ipc::StoreMapItems<C>::at(int) [with C = int]' at <br>
../../../../src/ipc/StoreMap.h:136:21,<br>
01:00:06     inlined from 'Rock::LoadingSlot::LoadingSlot(Rock::SlotId, <br>
Rock::LoadingParts&)' at ../../../../src/fs/rock/RockRebuild.cc:208:27:<br>
01:00:06 ../../../../src/ipc/mem/FlexibleArray.h:34:52: error: array <br>
subscript -1 is below array bounds of 'int [1]' [-Werror=array-bounds=]<br>
01:00:06    34 |     Item &operator [](const int idx) { return items[idx]; }<br>
01:00:06       | ~~~~~^<br>
01:00:06 ../../../../src/ipc/mem/FlexibleArray.h: In constructor <br>
'Rock::LoadingSlot::LoadingSlot(Rock::SlotId, Rock::LoadingParts&)':<br>
01:00:06 ../../../../src/ipc/mem/FlexibleArray.h:43:10: note: while <br>
referencing 'Ipc::Mem::FlexibleArray<int>::items'<br>
01:00:06    43 |     Item items[1]; // ensures proper alignment of array <br>
elements<br>
01:00:06       |          ^~~~~<br>
01:00:06 cc1plus: all warnings being treated as errors<br>
01:00:06 make[4]: *** [Makefile:986: rock/RockRebuild.lo] Error 1<br>
01:00:06 make[4]: Leaving directory <br>
'/srv/jenkins/workspace/5-pr-test/COMPILER/gcc/OS/fedora-rawhide/label/docker-build-host/btlayer-02-maximus/squid-7.0.0-VCS/_build/sub/src/fs'<br>
<br>
_______________________________________________<br>
squid-dev mailing list<br>
<a href="mailto:squid-dev@lists.squid-cache.org" target="_blank">squid-dev@lists.squid-cache.org</a><br>
<a href="http://lists.squid-cache.org/listinfo/squid-dev" rel="noreferrer" target="_blank">http://lists.squid-cache.org/listinfo/squid-dev</a><br>
</blockquote></div><br clear="all"><div><br></div><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature">    Francesco</div>