clang Warning: Padding Class...
Richard Kimberly Heck
rikiheck at lyx.org
Wed Feb 19 22:08:47 UTC 2020
>
> Le 19 février 2020 21:24:15 GMT+01:00, Richard Kimberly Heck
<rikiheck at lyx.org> a écrit :
>> I'm seeing a lot of warnings in QtCreator of the form:
>>
>> Buffer.cpp:219:11: warning: padding class 'lyx::Buffer::Impl' with 3
>> bytes to align 'filename'
>>
>> I take it that this is because there were five bools right before this
>> declaration. Do we care about this?
>
On 2/19/20 4:48 PM, Jean-Marc Lasgouttes wrote:
> It is a good idea to have correct padding by reordering members, even if the memory gains are minimal for buffer::impl . Do you have that for other classes ?
I have seen it elsewhere, but I can't remember where. There are so many
different warnings (a lot of them '0 used as nullptr', which Stephan
also mentioned), so it can be hard to sort through them. I'm going to
try to fix these as I have time. It's mindless...
> Note that padding needs are not the same for 32bist and 64bits, and probably not the same for Linux and windows.
Mostly these seem like 8-bit boundaries, but who knows. Putting bools at
the end seems an easy way to deal with it. Probably means re-ordering
initialization code, but not much else.
Riki
More information about the lyx-devel
mailing list