Proposal: readable and writable attributes on variables

Jeff Law law@redhat.com
Wed Sep 7 19:23:00 GMT 2016


On 09/01/2016 09:04 AM, Martin Sebor wrote:
>
> 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.
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.

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.

Jeff



More information about the Gcc mailing list