You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to compile luasql-odbc with latest MSYS2 version as described in issue #155, but I'm running in trouble.
This is due to the fact that MSYS2 now ships with GCC version 14.2.0
$ gcc --version
gcc.exe (Rev2, Built by MSYS2 project) 14.2.0
Copyright (C) 2024 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
The initial ISO C standard and its 1999 revision removed support for many C language features
that were widely known as sources of application bugs due to accidental misuse. For backwards
compatibility, GCC 13 and earlier diagnosed use of these features as warnings only. Although
these warnings have been enabled by default for many releases, experience shows that these
warnings are easily ignored, resulting in difficult to diagnose bugs. In GCC 14, these issues are
now reported as errors, and no output file is created, providing clearer feedback to programmers
that something is wrong.
Therefore, compilation now fails due to errors that used to be warnings in GCC 13:
luasql-odbc 2.6.0-3 depends on lua >= 5.1 (5.3-1 provided by VM)
gcc -O2 -fPIC -c -o src/luasql.o -IC:\msys64\mingw64/include/lua5.3 src/luasql.c -IC:/msys64/mingw64/include/
gcc -O2 -fPIC -c -o src/ls_odbc.o -IC:\msys64\mingw64/include/lua5.3 src/ls_odbc.c -IC:/msys64/mingw64/include/
src/ls_odbc.c: In function 'raw_execute':
src/ls_odbc.c:689:51: error: passing argument 2 of 'SQLRowCount' from incompatible pointer type [-Wincompatible-pointer-types]
689 | if(error(SQLRowCount(stmt->hstmt, &numrows))) {
| ^~~~~~~~
| |
| SQLINTEGER * {aka long int *}
In file included from C:/msys64/mingw64/include/sqlext.h:9,
from src/ls_odbc.c:16:
C:/msys64/mingw64/include/sql.h:550:66: note: expected 'SQLLEN *' {aka 'long long int *'} but argument is of type 'SQLINTEGER *' {aka 'long int *'}
550 | SQLRETURN SQL_API SQLRowCount(SQLHSTMT StatementHandle,SQLLEN *RowCount);
| ~~~~~~~~^~~~~~~~
src/ls_odbc.c: In function 'set_param':
src/ls_odbc.c:707:78: error: passing argument 10 of 'SQLBindParameter' from incompatible pointer type [-Wincompatible-pointer-types]
707 | SQL_DOUBLE, 0, 0, NULL, 0, &cbNull))) {
| ^~~~~~~
| |
| SQLINTEGER * {aka long int *}
+ many more errors
Any idea how to overcomes these errors? Maybe these errors are fixed already? Can I revert back to the old behaviour with GCC 14 in the meantime? Any help is appreciated!
The text was updated successfully, but these errors were encountered:
This code was updated: numrows' type is now SQLLEN, which should solve the problem. You could correct it manually or wait for the new version. We should release it soon
In case anyone else is needing this to work while pending a release, you can manually edit the odbc rockspec to use the master branch rather than the 2.6.0 release (which is 4 years old at this point).
e.g. change line 5 of luasql-odbc-2.6.0-3.rockspec to branch = "master",
and then run luarocks install luasql-odbc-2.6.0-3.rockspec
I'm trying to compile luasql-odbc with latest MSYS2 version as described in issue #155, but I'm running in trouble.
This is due to the fact that MSYS2 now ships with GCC version 14.2.0
As stated in Porting to GCC 14, GCC is more strict now:
Therefore, compilation now fails due to errors that used to be warnings in GCC 13:
Any idea how to overcomes these errors? Maybe these errors are fixed already? Can I revert back to the old behaviour with GCC 14 in the meantime? Any help is appreciated!
The text was updated successfully, but these errors were encountered: