This is the mail archive of the libffi-discuss@sourceware.org mailing list for the libffi project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: small return types


On 22.10.2017 13:33, Bruno Haible wrote:
The new documentation says:

  +That is, in most cases, @var{ret} points to an object of exactly the
  +size of the type specified when @var{cif} was constructed.  However,
  +integral types narrower than the system register size are widened.

Which is not useful, because the point of using a library such as libffi is to NOT NEED TO KNOW about the ABI, about the width of system registers
etc.

Unfortunately, that's the library interface that a test suite has
to exercise, and not the ideal one that we would like to exist in
it place.

This cannot be fixed without breaking correctly implemented programs
which follow the scheme.

Using the API right is slightly ugly but not a major complication.

My FFI implementation experience shows that it can be absorbed in a
design which didn't anticipate the issue at all, and in a reasonably localized
way which hides it from the higher levels.

The register size is abstracted by the ffi_arg type; applications don't
have to depend on how specific sizes in specific ways.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]