On Wed, 9 Mar 2022 at 13:27, Jakub Jelinek <ja...@redhat.com> wrote: > On Mon, Mar 07, 2022 at 03:37:18PM -0600, Segher Boessenkool wrote: > > > * config/rs6000/rs6000-gen-builtins.cc (TYPE_MAP_SIZE): Set to > > > 85 instead of 86. > > > > This should be auto-generated, or just not exist at all > > ("sizeof type_map / sizeof type_map[0]" in the one place it is used, > > instead -- "one place" is after removing it from the definition of the > > array of course, where it is unneeded :-) ) > > Unfortunately the generator doesn't use libiberty.h, so I couldn't use > ARRAY_SIZE. Just used sizeof / sizeof [0].
FWIW this could be simply std::size(type_map) in C++17. C++11 allows std::end(type_map) - std::begin(type_map) but that's not really an improvement. Those functions are all overloaded for arrays and deduce the array length.