luadbi icon indicating copy to clipboard operation
luadbi copied to clipboard

GCC 14: error: assignment to ‘my_bool *’ {aka ‘char *’} from incompatible pointer type ‘int *’ [-Wincompatible-pointer-types]

Open robert-scheck opened this issue 1 year ago • 8 comments

Trying to build LuaDBI 0.7.2 on Fedora Rawhide using GCC 14 fails like this (report from Fedora mass rebuild):

gcc -c -o build/dbd_mysql_statement.o dbd/mysql/statement.c -I/usr/include -g -pedantic -Wall -O2 -shared -fPIC -DPIC -std=c99 -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Wno-complain-wrong-lang -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -mbranch-protection=standard -fasynchronous-unwind-tables -fstack-clash-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -I. -shared -Wl,-z,relro -Wl,--as-needed   -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld-errors -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -Wl,--build-id=sha1 -specs=/usr/lib/rpm/redhat/redhat-package-notes  -I/usr/include/mysql -L/usr/lib64/mysql -lmysqlclient
dbd/mysql/statement.c: In function ‘statement_execute’:
dbd/mysql/statement.c:221:33: error: assignment to ‘my_bool *’ {aka ‘char *’} from incompatible pointer type ‘int *’ [-Wincompatible-pointer-types]
  221 |                 bind[i].is_null = (int*)1;
      |                                 ^
dbd/mysql/statement.c:230:33: error: assignment to ‘my_bool *’ {aka ‘char *’} from incompatible pointer type ‘int *’ [-Wincompatible-pointer-types]
  230 |                 bind[i].is_null = (int*)0;
      |                                 ^
dbd/mysql/statement.c:245:33: error: assignment to ‘my_bool *’ {aka ‘char *’} from incompatible pointer type ‘int *’ [-Wincompatible-pointer-types]
  245 |                 bind[i].is_null = (int*)0;
      |                                 ^
dbd/mysql/statement.c:256:33: error: assignment to ‘my_bool *’ {aka ‘char *’} from incompatible pointer type ‘int *’ [-Wincompatible-pointer-types]
  256 |                 bind[i].is_null = (int*)0;
      |                                 ^
make: *** [Makefile:82: build/dbd_mysql_statement.o] Error 1

Because of commit e951acfb0adf385a1cdf6d2a4b68435d62510a2b, only 3 not 4 occurrences exist in current code in Git.

robert-scheck avatar Jan 29 '24 22:01 robert-scheck