Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2.3.12: build fails with gcc 14.x #158

Open
kloczek opened this issue Feb 2, 2024 · 6 comments
Open

2.3.12: build fails with gcc 14.x #158

kloczek opened this issue Feb 2, 2024 · 6 comments

Comments

@kloczek
Copy link

kloczek commented Feb 2, 2024

Looks like with new gcc is reported [-Wimplicit-function-declaration] error

make[3]: Entering directory '/home/tkloczko/rpmbuild/BUILD/unixODBC-2.3.12/Drivers/nn'
/bin/sh ../../libtool  --tag=CC   --mode=compile /usr/bin/gcc -DHAVE_CONFIG_H -I. -I../..  -I../../include -I.   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -O2 -g -grecord-gcc-switches -pipe -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -fdata-sections -ffunction-sections -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -flto=auto -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -Wall -Werror=format-security -pthread -c -o yyparse.lo yyparse.c
libtool: compile:  /usr/bin/gcc -DHAVE_CONFIG_H -I. -I../.. -I../../include -I. -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -O2 -g -grecord-gcc-switches -pipe -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -fdata-sections -ffunction-sections -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -flto=auto -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -Wall -Werror=format-security -pthread -c yyparse.c  -fPIC -DPIC -o .libs/yyparse.o
yyparse.c: In function 'nnsql_yyparse':
yyparse.y:38:33: error: implicit declaration of function 'nnsql_yylex'; did you mean 'nnsql_yyinit'? [-Wimplicit-function-declaration]
   38 | # define yylex(pyylval)         nnsql_yylex(pyylval, pyyenv)
      |                                 ^~~~~~~~~~~
yyparse.c:1465:16: note: in expansion of macro 'yylex'
 1465 |       yychar = yylex (&yylval);
      |                ^~~~~
yyparse.y:374:17: warning: unused variable 'p' [-Wunused-variable]
  374 |         | search_condition kwd_or search_condition
      |                 ^
yyparse.y: In function 'unpack_col_name':
yyparse.y:824:7: warning: unused variable 'c' [-Wunused-variable]
  824 | static void     unpack_col_name(char* schema_tab_column_name, column_name_t* ptr)
      |       ^
yyparse.y: At top level:
yyparse.y:17:17: warning: 'sccsid' defined but not used [-Wunused-variable]
   17 | static  char    sccsid[]
      |                 ^~~~~~
make[3]: *** [Makefile:617: yyparse.lo] Error 1
@dememax
Copy link

dememax commented Apr 18, 2024

Under Gentoo:

/bin/sh ../../libtool  --tag=CC   --mode=compile x86_64-pc-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I/var/tmp/portage/dev-db/unixODBC-2.3.12/work/unixODBC-2.3.12/Drivers/Postgre7.1 -I../..  -I/var/tmp/portage/dev-db/unixODBC-2.3.12/work/unixODBC-2.3.12/include    -march=alderlake -mabm -mno-cldemote -mno-kl -mno-pconfig -mno-sgx -mno-widekl -mshstk --param=l1-cache-line-size=64 --param=l1-cache-size=32 --param=l2-cache-size=12288 -O2 -pthread -c -o md5.lo /var/tmp/portage/dev-db/unixODBC-2.3.12/work/unixODBC-2.3.12/Drivers/Postgre7.1/md5.c
/var/tmp/portage/dev-db/unixODBC-2.3.12/work/unixODBC-2.3.12/Drivers/Postgre7.1/info.c: In function 'SQLStatistics':
/var/tmp/portage/dev-db/unixODBC-2.3.12/work/unixODBC-2.3.12/Drivers/Postgre7.1/info.c:1868:63: error: passing argument 6 of 'PG_SQLBindCol' from incompatible pointer type [-Wincompatible-pointer-types]
 1868 |                                 column_name, MAX_INFO_STRING, &column_name_len);
      |                                                               ^~~~~~~~~~~~~~~~
      |                                                               |
      |                                                               int *
In file included from /var/tmp/portage/dev-db/unixODBC-2.3.12/work/unixODBC-2.3.12/Drivers/Postgre7.1/statement.h:18,
                 from /var/tmp/portage/dev-db/unixODBC-2.3.12/work/unixODBC-2.3.12/Drivers/Postgre7.1/info.c:42:
/var/tmp/portage/dev-db/unixODBC-2.3.12/work/unixODBC-2.3.12/Drivers/Postgre7.1/bind.h:49:39: note: expected 'SQLLEN *' {aka 'long int *'} but argument is of type 'int *'
   49 |                               SQLLEN *pcbValue);
      |                               ~~~~~~~~^~~~~~~~
/var/tmp/portage/dev-db/unixODBC-2.3.12/work/unixODBC-2.3.12/Drivers/Postgre7.1/info.c:1925:54: error: passing argument 6 of 'PG_SQLBindCol' from incompatible pointer type [-Wincompatible-pointer-types]
 1925 |                         index_name, MAX_INFO_STRING, &index_name_len);
      |                                                      ^~~~~~~~~~~~~~~
      |                                                      |
      |                                                      SDWORD * {aka int *}
/var/tmp/portage/dev-db/unixODBC-2.3.12/work/unixODBC-2.3.12/Drivers/Postgre7.1/bind.h:49:39: note: expected 'SQLLEN *' {aka 'long int *'} but argument is of type 'SDWORD *' {aka 'int *'}
   49 |                               SQLLEN *pcbValue);
      |                               ~~~~~~~~^~~~~~~~
/var/tmp/portage/dev-db/unixODBC-2.3.12/work/unixODBC-2.3.12/Drivers/Postgre7.1/info.c:1934:44: error: passing argument 6 of 'PG_SQLBindCol' from incompatible pointer type [-Wincompatible-pointer-types]
 1934 |                         fields_vector, 16, &fields_vector_len);
      |                                            ^~~~~~~~~~~~~~~~~~
      |                                            |
      |                                            SDWORD * {aka int *}
/var/tmp/portage/dev-db/unixODBC-2.3.12/work/unixODBC-2.3.12/Drivers/Postgre7.1/bind.h:49:39: note: expected 'SQLLEN *' {aka 'long int *'} but argument is of type 'SDWORD *' {aka 'int *'}
   49 |                               SQLLEN *pcbValue);
      |                               ~~~~~~~~^~~~~~~~
/var/tmp/portage/dev-db/unixODBC-2.3.12/work/unixODBC-2.3.12/Drivers/Postgre7.1/info.c: In function 'PG_SQLPrimaryKeys':
/var/tmp/portage/dev-db/unixODBC-2.3.12/work/unixODBC-2.3.12/Drivers/Postgre7.1/info.c:2220:51: error: passing argument 6 of 'PG_SQLBindCol' from incompatible pointer type [-Wincompatible-pointer-types]
 2220 |                         attname, MAX_INFO_STRING, &attname_len);
      |                                                   ^~~~~~~~~~~~
      |                                                   |
      |                                                   SDWORD * {aka int *}
/var/tmp/portage/dev-db/unixODBC-2.3.12/work/unixODBC-2.3.12/Drivers/Postgre7.1/bind.h:49:39: note: expected 'SQLLEN *' {aka 'long int *'} but argument is of type 'SDWORD *' {aka 'int *'}
   49 |                               SQLLEN *pcbValue);
      |                               ~~~~~~~~^~~~~~~~

But it's possible to turn on minimal use flag and all compiles.

@kloczek
Copy link
Author

kloczek commented Apr 18, 2024

Actually this issue has nothing to do with gcc version
It is result of use latest glibc + -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS in $CFLAGS which turns some warnings into errors.

@dememax
Copy link

dememax commented Apr 18, 2024

@kloczek All that I've done to have these errors, I've moved from gcc 13 to 14.
And I think the same will be with the modern clang:

Clang 15 (it's been reverted in 15.0.1) turns on the following as -Werror-by-default:

  • -Werror=implicit-function-declaration
  • -Werror=implicit-int
  • -Werror=strict-prototypes

From: https://bugs.gentoo.org/870412

@lurcher
Copy link
Owner

lurcher commented Apr 18, 2024 via email

@dememax
Copy link

dememax commented Apr 18, 2024

@lurcher Thanks! Indeed, it was already fixed on master by 45f501e

@jubalh
Copy link
Contributor

jubalh commented Apr 18, 2024

Also see #157 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants