OSDir


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: __attribute__


On Thu, Nov 1, 2018 at 3:31 PM Jim Jagielski <jim@xxxxxxxxxxx> 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...


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.