Re: [RFC][PATCH] A generic boolean

From: H. Peter Anvin
Date: Fri Aug 04 2006 - 15:03:12 EST


Jes Sorensen wrote:

And what will break if you make that switch?

If we are lucky, some binary only modules? :-)

But you're right, it may just have to be documented as one of those
nasty issues to watch out for.


What is really poisonous is structures which get padded when all the members are naturally aligned. Unfortunately gcc produces really crap code with __attribute__((packed)) on some architectures, so just using that isn't a good solution. On the other hand, non-AEABI ARM sometimes needs it!

For the lack of a __attribute__((nopad)) that would throw a warning or error on excessive padding, I fear that our best option is an __abi annotation which would enforce certain rules using sparse, and presumably provide __attribute__((packed)) on ARM:

- All padding must be explicit.
- All members must be naturally aligned.
- No unportable constructs, like non-int-sized bitfields.

-hpa
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/