On 07.06.2022 04:17, Stefano Stabellini wrote: > # Rule 9.4 "An element of an object shall not be initialized more than once" > > Andrew was noting that "There's one pattern using range syntax to set a > default where this rule would be violated, but the code is far cleaner > to read."
I'm actually not sure we have such uses, as I seem to vaguely recall clang warning about them. Off the top of your head, do you know of an instance, Andrew? Jan > Range initializers is a GCC extension not part of the C standard. It is > not considered by the MISRA rule. The MISRA rule seems focused on > preveting accidental double-initializations (by copy/pasting errors for > instance) which is fair. > > So I think we should be OK here and we need to clarify our usage of > range initializers. What we do or don't do with range initializer should > be a separate discussion I think. >