Hi,

I notice that dbi_result is currently typedefed to be a void*.
This is rather bad, because if the library user screws up while 
refactoring his dbi-using code (and that's almost a given),
compilers will not generate a warning because void* is implicitly 
convertible to other pointer types. For example,
 dbi_conn derp = dbi_conn_query(...)

To solve this, you have to declare, in dbi.h:

-typedef void * dbi_inst;
-typedef void * dbi_driver;
-typedef void * dbi_conn;  
-typedef void * dbi_result;
+typedef struct _dbi_inst *dbi_inst;
+typedef struct _dbi_driver *dbi_driver;
+typedef struct _dbi_conn *dbi_conn;
+typedef struct _dbi_result *dbi_result;

Then, the types cannot be mixed anymore, which is really what
is wanted.

------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60135991&iu=/4140/ostg.clktrk
_______________________________________________
Libdbi-drivers-devel mailing list
Libdbi-drivers-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libdbi-drivers-devel

Reply via email to