On Thu, Nov 1, 2018 at 3:31 PM Jim Jagielski <j...@jagunet.com> wrote:
> Since __attribute__ is used in various places in trunk and 2.4, is it safe > to assume that I can write something that requires __attribute__(packed)? No ... but surely you meant to write __attribute__((packed)) The real question is... why? It is sorely suboptimal except on x86_64 where the cpu handles the heavy lift ... the compiler must cope with it on MIPS/SPARC/POWER etc, may break atomic updates (our atomics don't protect against this), and doesn't address endianness. It all leads to lots of other questions... https://stackoverflow.com/questions/45116212/are-packed-structs-portable https://stackoverflow.com/questions/8568432/is-gccs-attribute-packed-pragma-pack-unsafe Adding this to any existing public struct definition is not backportable to 2.4.x. A use case would be helpful provide a fair answer to your question.