This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Default to -fstrict-volatile-bitfields for ARM EABI
On Fri, 3 Sep 2010, Jie Zhang wrote:
> > But the above is a description of an ABI for ISO C, where that issue does
> > not arise. For GNU C, where packed structures are permitted, clearly
> > being packed should take precedence over being volatile here so that GNU C
> > programs are properly portable across different architectures.
> >
> Why being packed should take precedence over being volatile here? I would say
Because it is not the job of an ABI to specify things conflicting with the
underlying language, only to specify things not specified by that
language. It is unambiguous that GNU C programs using packed structures
have particular semantics independent of the architecture, and that if the
semantics of a program are defined without volatile qualifiers, adding
such qualifiers should not cause the program to stop working. If parts of
the ABI only make sense for ISO C, not for GNU C, maybe GCC should
document a GNU C-compatible adaptation of those parts for the GNU C
extensions - but it should not implement a GNU C-incompatible variant.
--
Joseph S. Myers
joseph@codesourcery.com