This is the mail archive of the
mailing list for the GCC project.
Re: Proposal: readable and writable attributes on variables
- From: Jeff Law <law at redhat dot com>
- To: Martin Sebor <msebor at gmail dot com>, Jens Bauer <jens-lists at gpio dot dk>
- Cc: gcc at gcc dot gnu dot org
- Date: Wed, 7 Sep 2016 13:23:01 -0600
- Subject: Re: Proposal: readable and writable attributes on variables
- Authentication-results: sourceware.org; auth=none
- References: <firstname.lastname@example.org> <57C64493.email@example.com> <firstname.lastname@example.org> <57C8436A.email@example.com>
On 09/01/2016 09:04 AM, Martin Sebor wrote:
As you noted earlier Martin, if we bake it into the typesystem, then you
get the desired warnings when you mix-n-match types. For that reason I
see a type qualifier is superior to an attribute.
Understood. I think a write-only attribute or type qualifier would
make sense. Until/unless it's implemented I would recommend to work
around its absence by hiding access to the registers behind a read-
only and write-only functional API.
IIRC the national labs that were looking at the alignment attribute
essentially came to the same conclusion -- bake it into the core of the
typesystem and rely on the typesystem to ensure you don't lose the data.