svx/source/unodraw/unoprov.cxx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
New commits: commit 8d95452f66c01187c4b05a30061300125042cf46 Author: Stephan Bergmann <sberg...@redhat.com> AuthorDate: Wed Nov 3 15:51:34 2021 +0100 Commit: Stephan Bergmann <sberg...@redhat.com> CommitDate: Wed Nov 3 18:17:51 2021 +0100 Avoid false -Werror=array-bounds ...with recent GCC 12 trunk, > svx/source/unodraw/unoprov.cxx:904:28: error: array subscript 25 is above array bounds of ‘const SfxItemPropertyMapEntry* [25]’ [-Werror=array-bounds] > 904 | if(!aMapArr[nPropertyId]) { > | ~~~~~~~~~~~~~~~~~~~^ > In file included from svx/source/unodraw/shapeimpl.hxx:22, > from svx/source/unodraw/unoprov.cxx:45: > include/svx/unoprov.hxx:86:37: note: while referencing ‘SvxUnoPropertyMapProvider::aMapArr’ > 86 | SfxItemPropertyMapEntry const * aMapArr[SVXMAP_END]; > | ^~~~~~~ Change-Id: I60e5352aff0d0aed3056bc484fb1491626761051 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124655 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sberg...@redhat.com> diff --git a/svx/source/unodraw/unoprov.cxx b/svx/source/unodraw/unoprov.cxx index a421268cdd4a..39369d880448 100644 --- a/svx/source/unodraw/unoprov.cxx +++ b/svx/source/unodraw/unoprov.cxx @@ -17,6 +17,10 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include <sal/config.h> + +#include <cassert> + #include <sal/macros.h> #include <com/sun/star/table/XTable.hpp> #include <com/sun/star/container/XIndexAccess.hpp> @@ -900,7 +904,7 @@ SvxUnoPropertyMapProvider::~SvxUnoPropertyMapProvider() const SfxItemPropertyMapEntry* SvxUnoPropertyMapProvider::GetMap(sal_uInt16 nPropertyId) { - DBG_ASSERT(nPropertyId < SVXMAP_END, "Id ?" ); + assert(nPropertyId < SVXMAP_END); if(!aMapArr[nPropertyId]) { switch(nPropertyId) { case SVXMAP_SHAPE: aMapArr[SVXMAP_SHAPE]=ImplGetSvxShapePropertyMap(); break;