ovsqlite

Bo Lindbergh 2bfjdsla52kztwejndzdstsxl9athp at gmail.com
Tue Dec 22 03:32:18 UTC 2020


Quoth Julien ÉLIE <julien at trigofacile.com>:
> * In ovsqlite/ovsqlite.c, the ovsqlite_open() function does not use its argument "mode". Is it expected?  (for read-only or writable mode)

The current version doesn't care about the mode.  The right thing to do here
is to include it in the initial handshake and let the server process ignore it. 


> * fill_search_buffer() should be static.  (Fixed.)

Correct.


> * I'm facing 5 "cast increases required alignment of target type" errors.  Do you know how I could fix them?

The way to silence this warning is apparently to first cast to void *.

> ovsqlite/ovsqlite.c: Dans la fonction « finish_request »:
> ovsqlite/ovsqlite.c:143:6: attention: le transtypage augmente l'alignement requis pour le type ciblé [-Wcast-align]
>  143 |     *(uint32_t *)request->data = request->left;
>      |      ^
> ovsqlite/ovsqlite.c: Dans la fonction « read_response »:
> ovsqlite/ovsqlite.c:225:34: attention: le transtypage augmente l'alignement requis pour le type ciblé [-Wcast-align]
>  225 |                 response_size = *(uint32_t *)response->data;
>      |                                  ^
> ovsqlite/ovsqlite.c: Dans la fonction « fill_search_buffer »:
> ovsqlite/ovsqlite.c:584:20: attention: le transtypage augmente l'alignement requis pour le type ciblé [-Wcast-align]
>  584 |     rh->overview = (char **)store;
>      |                    ^

The first three are definitely safe since the input pointer comes
from the start of a malloc-ed buffer.

> ovsqlite/ovsqlite.c:587:19: attention: le transtypage augmente l'alignement requis pour le type ciblé [-Wcast-align]
>  587 |     rh->arrived = (time_t *)store;
>      |                   ^

The fourth one is safe as long as time_t does not have stricter alignment
than char *.

> ovsqlite/ovsqlite.c:590:18: attention: le transtypage augmente l'alignement requis pour le type ciblé [-Wcast-align]
>  590 |     rh->artnum = (ARTNUM *)store;
>      |                  ^

The fifth one is safe as long as ARTNUM does not have stricter alignment
than time_t.


> I do not manage to link innd:
> 
> 21:47 iulius at denver ~/work/inn/trunk/innd% ../libtool --mode=link /home/iulius/work/gcc/gcc-10.1.0/bin/gcc -pie -Wl,-z,relro -Wl,-z,now -o innd art.o cc.o chan.o icd.o innd.o keywords.o lc.o nc.o newsfeeds.o ng.o perl.o proc.o python.o rc.o site.o status.o util.o wip.o /home/iulius/work/inn/trunk/storage/libstorage.la/home/iulius/work/inn/trunk/history/libinnhist.la/home/iulius/work/inn/trunk/lib/libinn.la  -ldb -lz /home/iulius/work/inn/trunk/lib/perl.o -Wl,-E  -fstack-protector -L/usr/local/lib  -L/usr/lib/x86_64-linux-gnu/perl/5.20/CORE -lperl -ldl -lm -lpthread -lcrypt -L/usr/lib -lpython2.7 -lpthread -ldl -lutil -lm -L/usr/lib -lz -Xlinker -export-dynamic -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-z,relro
> /home/iulius/work/inn/trunk/storage/.libs/libstorage.so: undefined reference to `unpack_now'
> /home/iulius/work/inn/trunk/storage/.libs/libstorage.so: undefined reference to `unpack_later'
> /home/iulius/work/inn/trunk/storage/.libs/libstorage.so: undefined reference to `pack_later'
> /home/iulius/work/inn/trunk/storage/.libs/libstorage.so: undefined reference to `pack_now'

That is strange.  The pack_* and unpack_* functions are defined
in ovsqlite-private.c, which should be in METHOD_SOURCES.


I've collected fixes for the issues discussed so far:
 * #ifdef HAVE_SQLITE3 in ovsqlite-private.c
 * unused mode in ovsqlite_open
 * static fill_search_buffer
 * cast alignment warnings

Delta patch attached to this message (in git diff format, complain if that
doesn't work for you).

Full patch based on SVN revision 10457 here:
    https://www.stacken.kth.se/~blgl/inn-ovsqlite-take-2.diff.gz


/Bo Lindbergh
-------------- next part --------------
A non-text attachment was scrubbed...
Name: delta.diff.gz
Type: application/x-gzip
Size: 1964 bytes
Desc: not available
URL: <https://lists.isc.org/pipermail/inn-workers/attachments/20201222/436e4480/attachment.bin>


More information about the inn-workers mailing list