tech-net archive

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

Re: Adding ifam_pid to ifa_msghdr



On Thu, Sep 01, 2016 at 06:23:27PM +0700, Robert Elz wrote:
>   | but arguing that compilers can't implement the platform ABI correctly is
>   | somewhat of a stretch.
> 
> That's not what I said.   What I said was that the rules of C give compilers
> considerable latitude with inserting padding (or not) in structs.  Rational
> compilers aren't likely to abuse that, but compilers can - inserting extra
> padding, or not inserting some that one might prefer.

All the ABI contracts we provide are according to the ABI rules of the
corresponding platform. That provides a *very* tight list of
restrictions for any non-internal interface. A compiler is *not* free to
insert padding in random places without violating the platform ABI. If a
user wants to use a non-compatible compiler, it is up to them. But it is
not something we can or should care about. If a compiler is not willing
to follow the ABI rules, the system can't in any reasonable way interact
with it.

All that said: there are certainly reasons why structures with
explicitly sized fields and no possibility for internal padding are
useful. They can avoid the need for re-serialisation logic for netbsd32
and other multi-ABI situations. But that's quite a bit more involved.

Joerg


Home | Main Index | Thread Index | Old Index