perl5-dbi/DBD-mysql

installation fails with compiler error: incompatible integer to pointer conversion assigning to 'MYSQL_RES *'

svacht opened this issue · 5 comments

DBD::mysql version

5.003

MySQL client version

8.3.0

Server version

8.3.0

Operating system version

macOS 14.4

What happened?

I followed instructions for installing on macOS but I kept getting dbdimp.c:2796:12:error: incompatible integer to pointer conversion assigning to 'MYSQL_RES *' (aka 'struct MYSQL_RES *') from 'int' [-Wint-conversion]
I succeeded only by adding to cflags switch: -Wno-error=int-conversion
Complete successful cpanm command was:
cpanm --configure-args="--libs='-L/usr/local/opt/mysql/lib -lmysqlclient -lz -lzstd -lssl -lcrypto -lresolv' --cflags='-I/usr/local/opt/mysql/include/mysql -Wno-error=int-conversion'" --force DBD::mysql

Other information

No response

Did it report a line number?

yes, sorry, dbdimp.c:2796:12:

This is line 2796 in DBD::mysql 5.003:

https://github.com/perl5-dbi/DBD-mysql/blob/5_003/dbdimp.c#L2796

  • This line has been changed in 5.004 ( a5b8b36 )
  • This line again has changed in master ( 08ce2ec )

For me (on Linux with GCC 13.2.1) this works without errors:

perl Makefile.PL --cflags "$(mysql_config --cflags) -Wint-conversion"
make