Thanks for the reviews. Eric Botcazou <ebotca...@adacore.com> writes: >> This patch makes bit_field_mode_iterator take -fstrict-volatile-bitfields >> into account, in cases where the size of the underlying object is known. >> This is used in the next patch. > > Do we really need to add that to the iterator? The -fstrict-volatile- > bitfields implementation is still controversial so I'm not sure that we want > let it spread. Can't the client code just skip the problematic modes?
The idea was to centralise the knowledge about what modes are valid rather than requiring every client to know the rules. From that point of view it seems inconsistent for the new interface to handle the bitregion_{start,end} restrictions (a correctness issue) but not the volatility restrictions (also a correctness issue). Especially when the interface already knows whether the field is volatile and already handles the choice between "narrow" and "wide" volatile bitfields. If there's talk of removing -fstrict-volatile or changing its semantics then handling it in the interface ought to make that easier. Richard