[SPL] [PATCH] "Fix" compiler warning in mod_spl_splite.c
Bernd Petrovitsch
bernd at firmix.at
Sun Apr 2 20:22:28 CEST 2006
On Fri, 2006-03-31 at 18:54 +0200, Clifford Wolf wrote:
> Hi,
>
> On Sun, Mar 26, 2006 at 09:15:17PM +0200, Bernd Petrovitsch wrote:
> > The attached patch fixes
> > ---- snip ----
> > gcc -std=gnu99 -Wall -I/home/bernd/src/spl/svn-trunk -I/usr/include/kde -I/usr/lib64/qt-3.3/include -I/usr/local/include -fPIC -DENABLE_REGEX_SUPPORT -DENABLE_READLINE_SUPPORT -pthread -DENABLE_PTHREAD_SUPPORT -Os -fomit-frame-pointer -Werror -Wextra -I/usr/include -c -o spl_modules/mod_sql_sqlite.o spl_modules/mod_sql_sqlite.c
> > cc1: warnings being treated as errors
> > spl_modules/mod_sql_sqlite.c: In function ???sqlite_open_callback???:
> > spl_modules/mod_sql_sqlite.c:98: warning: dereferencing type-punned pointer will break strict-aliasing rules
> > make: *** [spl_modules/mod_sql_sqlite.o] Error 1
> > ---- snip ----
> > See http://www.ethereal.com/lists/ethereal-dev/200309/msg00342.html for
> > more about it.
>
> fixed in rev 839.
> but again with a different solution:
>
> --- spl_modules/mod_sql_sqlite.c (revision 837)
> +++ spl_modules/mod_sql_sqlite.c (working copy)
> @@ -95,7 +95,10 @@
> else
> filename = strdup(data);
>
> - int rc = sqlite3_open(filename, (sqlite3**)&hnd->backend_data);
> + sqlite3 *backend_data;
> + int rc = sqlite3_open(filename, &backend_data);
> + hnd->backend_data = backend_data;
> +
Yes. A looked for a similar solution but found only a worng one (and
cancelled the hacking).
Bernd
--
Firmix Software GmbH http://www.firmix.at/
mobil: +43 664 4416156 fax: +43 1 7890849-55
Embedded Linux Development and Services
More information about the SPL
mailing list