mwild1 / luadbi

Multi-backend SQL database library for Lua
MIT License
41 stars 15 forks source link

Avoid incompatible pointer type error on x86 (32 bit) #76

Closed robert-scheck closed 1 month ago

robert-scheck commented 7 months ago

Build using GCC 14 fails on Fedora Rawhide (= 41) on i686 like this:

dbd/mysql/statement.c: In function ‘statement_execute’: dbd/mysql/statement.c:271:40: error: assignment to ‘long unsigned int *’ from incompatible pointer type ‘size_t *’ {aka ‘unsigned int *’} [-Wincompatible-pointer-types]
  271 |                         bind[i].length = str_len;
      |                                        ^
make: *** [Makefile:82: build/dbd_mysql_statement.o] Error 1

Thus for x86 (32 bit) cast size_t * (= unsigned int *) to unsigned long * (= long unsigned int *); fixes #72 finally.

It's unsigned long *length; (= long unsigned int *) for at least:

MySQL:

MariaDB:

MariaDB Connector/C:

sparked435 commented 7 months ago

This looks good to me but I want to double-check on some of my more obscure platforms before merging.

robert-scheck commented 5 months ago

This looks good to me but I want to double-check on some of my more obscure platforms before merging.

What's the result of your double-checks?