Skip to content

Recursive call of referenceEmbeddings leads to millions of warnings

In the ReferenceElementImplementation there is a helper function referenceEmbeddings() (https://gitlab.dune-project.org/core/dune-geometry/-/blob/master/dune/geometry/referenceelementimplementation.hh?ref_type=heads#L213) that is implemented recursively. The case dim == 0 is not handled explicitly but might occure in this recursive instantiation. Recent compilers, e.g. gcc-12, instantiate this function and then give lots of warnings (with -Wall) about array access with index size_t(-1). This is resulting from array[dim-1] probably.

This function is unfortunately undocumented. I don't know what it should return and how the case dim = 0 should behave. A simple solution would be to handle this case explicitly to silence the warning.

Edited by Simon Praetorius