You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ctest: support variadics in function pointers #4367
@mbyx I think that with c_variadic being stabilized this may "just work" now (assuming we test on nightly of course). Would you mind submitting a PR testing it?
Actually, since the way foreign functions are tested changed in the new ctest, we don't construct the type at all. The variadic part remains in the C source, but is never used in the .C test (because we cast to a void pointer), nor in the Rust test (since we just call the foreign_fn_ptr function that takes no arguments and just returns a function pointer with no type information).
It would really only affect structs that have a function pointer I think.
I believe the PR also handles function pointers as well. I just checked locally by adding a variadic function pointer to a struct field in the tests, and the tests seem to pass:
Activity
tgross35 commentedon Aug 4, 2026
We have the
c_variadicfeature stabilizing in the next version rust-lang/rust#155697, this should make things more workable.tgross35 commentedon Aug 4, 2026
@mbyx I think that with
c_variadicbeing stabilized this may "just work" now (assuming we test on nightly of course). Would you mind submitting a PR testing it?tgross35 commentedon Aug 4, 2026
Actually some of the syntax bits may have to be updated to emit
...mbyx commentedon Aug 7, 2026
Actually, since the way foreign functions are tested changed in the new ctest, we don't construct the type at all. The variadic part remains in the C source, but is never used in the .C test (because we cast to a void pointer), nor in the Rust test (since we just call the
foreign_fn_ptrfunction that takes no arguments and just returns a function pointer with no type information).It would really only affect structs that have a function pointer I think.
[-]ctest: support varidics[/-][+]ctest: support variadics[/+]tgross35 commentedon Aug 9, 2026
That PR pretty much fixed everything but it would be good to handle function pointers as well, so I'll reopen for that
[-]ctest: support variadics[/-][+]ctest: support variadics in function pointers[/+]mbyx commentedon Aug 9, 2026
I believe the PR also handles function pointers as well. I just checked locally by adding a variadic function pointer to a struct field in the
tests, and the tests seem to pass:Which generates this test (among others):
If this is enough, then when I eventually make a PR regarding testing improvements, I'll add in this specific test as well.
tgross35 commentedon Aug 9, 2026
Oh awesome! Yeah that's all, a test would be great