[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH 01/24] xen/mm: Don't use _{g, m}fn for defining INVALID_{G, M}FN



>>> On 14.06.17 at 11:40, <julien.grall@xxxxxxx> wrote:
> On 06/14/2017 09:49 AM, Tim Deegan wrote:
>> At 17:13 +0100 on 13 Jun (1497373980), Julien Grall wrote:
>>> INVALID_{G,M}FN are defined using static inline helpers _{g,m}fn.
>>> This means, they cannot be used to initialize a build time static variable:
>>>
>>> In file included from mm.c:24:0:
>>> xen/xen/include/xen/mm.h:59:26: error: initializer element is not constant
>>>   #define INVALID_MFN      _mfn(~0UL)
>>>
>>> Signed-off-by: Julien Grall <julien.grall@xxxxxxx>
>> 
>> Acked-by: Tim Deegan <tim@xxxxxxx>
>> 
>>> I know that this solution will not work for non-debug build. I would
>>> like input from the community on way to fix it nicely.
>> 
>> It seems to WFM: https://godbolt.org/g/vEVNY3 
> 
> To be honest, I thought it would not work and a bit surprised that it 
> actually works.

Me too - it didn't occur to me that the extension "Compound Literals"
also, contrary to its name, covers scalar types. But it's indeed
documented, so we don't need to be afraid of it going away.
Remains the question whether our oldest supported gcc allows it.
The oldest one I can easily try (4.3.something) works fine.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.