cochran_emc.h: packed structs

Lubomir I. Ivanov neolit123 at gmail.com
Tue Oct 28 09:03:27 PDT 2014


On 28 October 2014 17:54, Thiago Macieira <thiago at macieira.org> wrote:
> On Tuesday 28 October 2014 17:39:27 Lubomir I. Ivanov wrote:
>> > __declspec(packed)
>>
>> i don't have that in MSVC 2003; perhaps it's a newer feature.
>
> Yeah, I was wrong, it's not there.
>
> http://msdn.microsoft.com/en-us/library/dabb5z75.aspx
>
> That's probably why the GCC attribute is disabled in MinGW for "MS struct"
> compatibility. So it's not a bug, it's a feature.
>
> The suggestion is to not require packing of structs. Reorder the members so
> you don't need packing, if you can, or try to use different types if you really
> need the members in that order due to data storage or protocol.
>
> That said, the cochran_emc_log_t structure only uses unsigned char. I don't
> see why packing is necessary in the first place.
>

ok, i see.

it was in the GCC bugzilla so i though it was an actual bug.
not sure where they have documented it.

updated patch to remove the packing for cochran_emc_log_t - missed that.

lubomir
--
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0005-Use-gcc_struct-with-the-packed-attribute.patch
Type: application/octet-stream
Size: 2243 bytes
Desc: not available
URL: <http://lists.subsurface-divelog.org/pipermail/subsurface/attachments/20141028/4f03741e/attachment.obj>


More information about the subsurface mailing list