During compiling time of wxSQLite3 in UNICODE mode, I got the following warning:
warning: cannot pass objects of non-POD type `const class wxCharBuffer' through `...'; call will abort at runtime
This correspond to wxSQLite3Database::TableExists. When I use this function in a program, the app crash (seems a sprintf problem).
Compiler: gcc (GCC) 3.4.4 (mingw special)
wxWidgets: 2.6.2 (UNICODE)
wxSQLite3: 1.3.1 (UNICODE)
IDE: Code::Blocks RC2
Note: Sorry for my poor english
[wxSQLite3] wxSQLite3Database::TableExists and MinGW Topic is solved
Re: [wxSQLite3] wxSQLite3Database::TableExists and MinGW
I use VC6 for development on Windows with the highest possible warning level, but no warning ... and no crash. Nevertheless the gcc warning is correct and the code should be fixed to eliminate that warning. Fortunately the solution is simple:lrm wrote:During compiling time of wxSQLite3 in UNICODE mode, I got the following warning:
warning: cannot pass objects of non-POD type `const class wxCharBuffer' through `...'; call will abort at runtime
This correspond to wxSQLite3Database::TableExists. When I use this function in a program, the app crash (seems a sprintf problem).
Compiler: gcc (GCC) 3.4.4 (mingw special)
wxWidgets: 2.6.2 (UNICODE)
wxSQLite3: 1.3.1 (UNICODE)
IDE: Code::Blocks RC2
Please change the lines in method wxSQLite3Database::TableExists from
Code: Select all
sprintf(localSql,
"select count(*) from sqlite_master where type='table' and name='%s'",
localTableName);
Code: Select all
sprintf(localSql,
"select count(*) from sqlite_master where type='table' and name='%s'",
(const char*) localTableName);
Regards,
Ulrich