This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Proposal: readable and writable attributes on variables


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]