On second thought, by using a va_list as a callback argument we lose type safety. The code currently only uses a single call site for each callback, so keeping callers and callees in sync is not an issue, but if anyone has strong feelings about this, I am okay with modifying the code to pass all the arguments explicitly instead of using a va_list.