On 1/14/23 7:18 AM, Maxime Devos wrote:
\
Port objects should be accepted too, as previously asked on <https://lists.gnu.org/archive/html/guile-user/2022-06/msg00060.html>. As implied by later comments, using a raw fd causes problems with 'move->fdes'.  For the remaining response, I'll assume that the function accepts ports as well.


To avoid this problem, you can add

  scm_remember_upto_here_1 (fd);

after the SCM_SYSCALL.
\


IIRC there is a C trick involving fields, arrays and types to check this at compile-time instead.  Maybe:

struct whatever {
   /* if availability of zero-length arrays can be assumed */
   int foo[sizeof(size_t) - sizeof(void*)];
   /* alternatively, a weaker but portable check */
   int foo[sizeof(size_t) - sizeof(void*) + 1];
};

Greetings,
Maxime.

Thanks for the feedback.   I'm sorry I missed you comments on the previous round.
I did respond to the ones I did catch.    I'll work this and resubmit.

Matt


Reply via email to