On 13/06/17 17:13, 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.gr...@arm.com>
> ---
> Cc: Andrew Cooper <andrew.coop...@citrix.com>
> Cc: George Dunlap <george.dun...@eu.citrix.com>
> Cc: Ian Jackson <ian.jack...@eu.citrix.com>
> Cc: Jan Beulich <jbeul...@suse.com>
> Cc: Konrad Rzeszutek Wilk <konrad.w...@oracle.com>
> Cc: Stefano Stabellini <sstabell...@kernel.org>
> Cc: Tim Deegan <t...@xen.org>
> Cc: Wei Liu <wei.l...@citrix.com>
>
> 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.

Hmm - a proper typedef gets inserted.  I presume the compiler objects to
(unsigned long){ ~0UL } to initialise a scalar?

It might be better to move the definition of INVALID_$FOO into the
TYPE_SAFE() declaration so we can create an appropriate initialiser for
each both builds.

~Andrew

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

Reply via email to