On 2019/6/17 下午11:37, James Bottomley wrote: > On Mon, 2019-06-17 at 17:06 +0800, Qu Wenruo wrote: > [...] >> But then this means, we should have two copies of data for every such >> structures. One for the fixed format one, and one for the compiler >> aligned one, with enough helper to convert them (along with needed >> endian convert). > > I don't think it does mean this. The compiler can easily access the > packed data by pointer, the problem on systems requiring strict > alignment is that it has to be done with byte accesses, so instead of a > load word for a pointer to an int, you have to do four load bytes. > This is mostly a minor slowdown so trying to evolve a whole > infrastructure around copying data for these use cases really wouldn't > be a good use of resources. Then I can argue it shouldn't be a default warning for GCC 9. But anyway, kernel will disable the warning, so I think it shouldn't cause much problem. Thanks, Qu > > James >
Attachment:
signature.asc
Description: OpenPGP digital signature