Yahoo Groups archive

Lpc2000

Index last updated: 2026-04-28 23:31 UTC

Message

Re: Misaligned structure fields, works regardless... Structure packing?

2005-12-23 by Thiadmer Riemersma (ITB CompuPhase)

Hello Tom,

> No, it is the exact reason you declare a structure to be packed.

What I meant to do is have all members in the structure to be packed
relative to each other (i.e. no padding between the fields), but
aligning the first member to its "natural alignment".

Most of this is due to libraries that are supposed to be portable and
that deal with file/protocol formats. I guess I started seeing
__attribute__((packed)) and the equivalent on other compilers as a
magic "fix all my problems" solution.

Thanks,
Thiadmer

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.