DBI backend warnings with Glib 2.16.3

Phil Longstaff plongstaff at rogers.com
Mon Jul 14 11:47:34 EDT 2008


David Reiser wrote:
> gnc-backend-dbi.c needs the tweak to stomp out GType warnings:
> 
> gnc-backend-dbi.c:948: warning: format ‘%d’ expects type ‘int’, but
> argument 5 has type ‘GType’
> gnc-backend-dbi.c:964: warning: format ‘%d’ expects type ‘int’, but
> argument 5 has type ‘GType’
> gnc-backend-dbi.c:980: warning: format ‘%d’ expects type ‘int’, but
> argument 5 has type ‘GType’
> 
> Based on the fix either you or Derek suggested last time, replacing the
> PERR on those lines with
> PERR( "Unknown GType: '%s'\n", g_type_name(G_VALUE_TYPE(type)));
> 
> Works for me.

Fixed in r17326

> 
> Does DBI protect us well enough that a user can change the database
> backend without recompiling gnucash? (Presuming, of course, that any dbi
> drivers added later get installed in the same place gnucash
> finds/assigns the original set used.)

With DBI, a connection is created using a specific driver, and then
certain driver-specific properties are set by name.  It might be
possible to design a URL format so that this could be done generally for
any backend.  However, DBI does not provide any abstraction for table
creation, so the gnucash dbi backend needs code to pick specific column
types in certain circumstances.  Therefore, you can't just add a new
driver and have it automatically usable.

Phil



More information about the gnucash-devel mailing list