Re: [PATCH] Prevent use of MEM_* attr accessor macros as lvalues

2016-12-08 Thread Bernd Schmidt
On 12/09/2016 03:02 AM, David Malcolm wrote: The following patch leads to errors like this for that kind of mistake: error: assignment of member 'mem_attrs::offset' in read-only object MEM_OFFSET (x) = atoi (name.string); ^ Successfully

[PATCH] Prevent use of MEM_* attr accessor macros as lvalues

2016-12-08 Thread David Malcolm
On Thu, 2016-12-08 at 21:08 +0100, Bernd Schmidt wrote: > On 12/08/2016 09:39 PM, David Malcolm wrote: > > > > OK as adjustments to patches 8a and 8b? > > Ok. Is it possible to adjust these macros to return something like a > const reference to ensure people can't make this kind of error? > >