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

Re: [Xen-devel] [PATCH v10 2/6] xen: introduce DEFINE_SYMBOL



>>> On 26.02.19 at 18:32, <ian.jackson@xxxxxxxxxx> wrote:
> Jan Beulich writes ("Re: [PATCH v10 2/6] xen: introduce DEFINE_SYMBOL"):
>> On 26.02.19 at 17:46, <ian.jackson@xxxxxxxxxx> wrote:
>> > I am not aware of a standard C type which could be used instead of
>> > this struct.  But I think you can use the `packed' attribute to get
>> > the right behaviour.  The GCC manual says:
>> > 
>> >  | Alignment can be decreased by specifying the 'packed' attribute.
>> >  | See below.
> ...
>> Until I've looked at this (again) now, I wasn't even aware that
>> one can combine packed and aligned attributes in a sensible
>> way. May I suggest that, because of this being a theoretical
>> issue only at this point, we limit ourselves to the build time
>> assertion you suggest?
> 
> I am not suggesting combining `packed' and `aligned'.  I am suggesting
> only `packed' (but based on text which is in the manual section for
> `aligned').  But I am happy with a build-time assertion if you don't
> want to add `packed'.  That is just as safe.

But "packed" alone reduces alignment to the minimum, i.e. one byte.
That would immediately break the build time assertion you've suggested
to add.

Jan



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

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