gnucash master: Add failing unittest for aqbanking lookup of trans_retrieval date.

Christian Stimming christian at cstimming.de
Mon Sep 8 14:16:42 EDT 2014


Am Montag, 8. September 2014, 07:17:47 schrieb John Ralls:
> On Sep 8, 2014, at 5:31 AM, Christian Stimming <christian at cstimming.de> 
wrote:
> > Zitat von John Ralls <jralls at ceridwen.us>:
> >>> recently I noticed the "trans-retrieval" slot in the aqbanking account
> >>> doesn't remember its value.
> >> 
> >> Christian,
> >> 
> >> Yeah, fixed and pushed, e210f8c.
> >> 
> >> The difference was that your test used the defective accessor function
> >> and mine used qof_instance_get directly with the right parameter type
> >> (Timespec ** instead of Timespec *).> 
> > Ah, the wonders of zero compile-time checks of variable argument lists in
> > C...
> > 
> > Thanks a lot for fixing this!
> 
> It's not C's fault; C compiler's know the difference between pointers and
> pointers-to-pointers and how to raise type errors. It's GValue's conversion
> of everything to void* that defeats the type checking.

Err... no, it is indeed C's fault: The function in question, qof_instance_get 
and set, uses a variable argument list (variadic arguments), terminated by the 
NULL pointer in the call, and this variable arguments are not at all compile-
time checked. Using qof_instance_get is what you inserted here in 
272655b60c0e30726, including the bug you fortunately now fixed. If there is 
another interface that gives us some more compile time checking, feel free to 
propose it here and/or in the docs of qof_instance_get. Or is this just a 
fundamental (bad) property of g_object's property system that we can't avoid?

Best Regards,

Christian


More information about the gnucash-devel mailing list