Skip to content

GCC 15: psqlodbc.h:300:23: error: 'bool' cannot be defined via 'typedef' #94

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

Open
df7cb opened this issue Mar 1, 2025 · 5 comments
Open

Comments

@df7cb
Copy link

df7cb commented Mar 1, 2025

From https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1097661:

psqlodbc fails to build with GCC 15:

libtool: compile:  gcc -DHAVE_CONFIG_H -I. -Wdate-time -D_FORTIFY_SOURCE=2 -I/usr/include -I/usr/include/postgresql -I/usr/include/postgresql/internal -DUNICODE_SUPPORT -g -O2 -Werror=implicit-function-declaration -ffile-prefix-map=/home/myon/projects/postgresql/psqlodbc/psqlodbc=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -Wall -c multibyte.c  -fPIC -DPIC -o .libs/psqlodbcw_la-multibyte.o
In file included from lobj.h:13,
                 from lobj.c:15:
psqlodbc.h:300:23: error: 'bool' cannot be defined via 'typedef'
  300 | typedef unsigned char bool;
      |                       ^~~~
psqlodbc.h:300:23: note: 'bool' is a keyword with '-std=c23' onwards
psqlodbc.h:300:1: warning: useless type name in empty declaration
  300 | typedef unsigned char bool;
      | ^~~~~~~
In file included from convert.h:12,
                 from convert.c:20:
psqlodbc.h:300:23: error: 'bool' cannot be defined via 'typedef'
  300 | typedef unsigned char bool;
      |                       ^~~~
psqlodbc.h:300:23: note: 'bool' is a keyword with '-std=c23' onwards
psqlodbc.h:300:1: warning: useless type name in empty declaration
  300 | typedef unsigned char bool;
      | ^~~~~~~
In file included from environ.h:16,
                 from environ.c:16:
psqlodbc.h:300:23: error: 'bool' cannot be defined via 'typedef'
  300 | typedef unsigned char bool;
      |                       ^~~~
psqlodbc.h:300:23: note: 'bool' is a keyword with '-std=c23' onwards
psqlodbc.h:300:1: warning: useless type name in empty declaration
  300 | typedef unsigned char bool;
      | ^~~~~~~
In file included from info.c:19:
psqlodbc.h:300:23: error: 'bool' cannot be defined via 'typedef'
  300 | typedef unsigned char bool;
      |                       ^~~~
psqlodbc.h:300:23: note: 'bool' is a keyword with '-std=c23' onwards
psqlodbc.h:300:1: warning: useless type name in empty declaration
  300 | typedef unsigned char bool;
      | ^~~~~~~
In file included from statement.h:12,
                 from statement.c:21:
psqlodbc.h:300:23: error: 'bool' cannot be defined via 'typedef'
  300 | typedef unsigned char bool;
      |                       ^~~~
psqlodbc.h:300:23: note: 'bool' is a keyword with '-std=c23' onwards
psqlodbc.h:300:1: warning: useless type name in empty declaration
  300 | typedef unsigned char bool;
      | ^~~~~~~
In file included from execute.c:16:
psqlodbc.h:300:23: error: 'bool' cannot be defined via 'typedef'
  300 | typedef unsigned char bool;
      |                       ^~~~
psqlodbc.h:300:23: note: 'bool' is a keyword with '-std=c23' onwards
psqlodbc.h:300:1: warning: useless type name in empty declaration
  300 | typedef unsigned char bool;
      | ^~~~~~~
In file included from bind.h:12,
                 from bind.c:19:
psqlodbc.h:300:23: error: 'bool' cannot be defined via 'typedef'
  300 | typedef unsigned char bool;
      |                       ^~~~
psqlodbc.h:300:23: note: 'bool' is a keyword with '-std=c23' onwards
psqlodbc.h:300:1: warning: useless type name in empty declaration
  300 | typedef unsigned char bool;
      | ^~~~~~~
In file included from connection.h:12,
                 from connection.c:22:
psqlodbc.h:300:23: error: 'bool' cannot be defined via 'typedef'
  300 | typedef unsigned char bool;
      |                       ^~~~
psqlodbc.h:300:23: note: 'bool' is a keyword with '-std=c23' onwards
psqlodbc.h:300:1: warning: useless type name in empty declaration
  300 | typedef unsigned char bool;
      | ^~~~~~~
In file included from pgtypes.h:12,
                 from pgtypes.c:19:
psqlodbc.h:300:23: error: 'bool' cannot be defined via 'typedef'
  300 | typedef unsigned char bool;
      |                       ^~~~
psqlodbc.h:300:23: note: 'bool' is a keyword with '-std=c23' onwards
psqlodbc.h:300:1: warning: useless type name in empty declaration
  300 | typedef unsigned char bool;
      | ^~~~~~~
In file included from pgtypes.h:12,
                 from columninfo.c:15:
psqlodbc.h:300:23: error: 'bool' cannot be defined via 'typedef'
  300 | typedef unsigned char bool;
      |                       ^~~~
psqlodbc.h:300:23: note: 'bool' is a keyword with '-std=c23' onwards
psqlodbc.h:300:1: warning: useless type name in empty declaration
  300 | typedef unsigned char bool;
      | ^~~~~~~
In file included from options.c:16:
psqlodbc.h:300:23: error: 'bool' cannot be defined via 'typedef'
  300 | typedef unsigned char bool;
      |                       ^~~~
psqlodbc.h:300:23: note: 'bool' is a keyword with '-std=c23' onwards
psqlodbc.h:300:1: warning: useless type name in empty declaration
  300 | typedef unsigned char bool;
      | ^~~~~~~
In file included from drvconn.c:15:
psqlodbc.h:300:23: error: 'bool' cannot be defined via 'typedef'
  300 | typedef unsigned char bool;
      |                       ^~~~
psqlodbc.h:300:23: note: 'bool' is a keyword with '-std=c23' onwards
psqlodbc.h:300:1: warning: useless type name in empty declaration
  300 | typedef unsigned char bool;
      | ^~~~~~~
In file included from multibyte.h:8,
                 from multibyte.c:11:
psqlodbc.h:300:23: error: 'bool' cannot be defined via 'typedef'
  300 | typedef unsigned char bool;
      |                       ^~~~
psqlodbc.h:300:23: note: 'bool' is a keyword with '-std=c23' onwards
psqlodbc.h:300:1: warning: useless type name in empty declaration
  300 | typedef unsigned char bool;
      | ^~~~~~~
In file included from qresult.h:12,
                 from qresult.c:19:
psqlodbc.h:300:23: error: 'bool' cannot be defined via 'typedef'
  300 | typedef unsigned char bool;
      |                       ^~~~
psqlodbc.h:300:23: note: 'bool' is a keyword with '-std=c23' onwards
psqlodbc.h:300:1: warning: useless type name in empty declaration
  300 | typedef unsigned char bool;
      | ^~~~~~~
In file included from results.c:18:
psqlodbc.h:300:23: error: 'bool' cannot be defined via 'typedef'
  300 | typedef unsigned char bool;
      |                       ^~~~
psqlodbc.h:300:23: note: 'bool' is a keyword with '-std=c23' onwards
psqlodbc.h:300:1: warning: useless type name in empty declaration
  300 | typedef unsigned char bool;
      | ^~~~~~~
In file included from tuple.h:16,
                 from tuple.c:20:
psqlodbc.h:300:23: error: 'bool' cannot be defined via 'typedef'
  300 | typedef unsigned char bool;
      |                       ^~~~
psqlodbc.h:300:23: note: 'bool' is a keyword with '-std=c23' onwards
psqlodbc.h:300:1: warning: useless type name in empty declaration
  300 | typedef unsigned char bool;
      | ^~~~~~~
In file included from psqlodbc.c:21:
psqlodbc.h:300:23: error: 'bool' cannot be defined via 'typedef'
  300 | typedef unsigned char bool;
      |                       ^~~~
psqlodbc.h:300:23: note: 'bool' is a keyword with '-std=c23' onwards
psqlodbc.h:300:1: warning: useless type name in empty declaration
  300 | typedef unsigned char bool;
      | ^~~~~~~
In file included from dlg_specific.h:12,
                 from dlg_specific.c:21:
psqlodbc.h:300:23: error: 'bool' cannot be defined via 'typedef'
  300 | typedef unsigned char bool;
      |                       ^~~~
psqlodbc.h:300:23: note: 'bool' is a keyword with '-std=c23' onwards
psqlodbc.h:300:1: warning: useless type name in empty declaration
  300 | typedef unsigned char bool;
      | ^~~~~~~
In file included from misc.c:15:
psqlodbc.h:300:23: error: 'bool' cannot be defined via 'typedef'
  300 | typedef unsigned char bool;
      |                       ^~~~
psqlodbc.h:300:23: note: 'bool' is a keyword with '-std=c23' onwards
psqlodbc.h:300:1: warning: useless type name in empty declaration
  300 | typedef unsigned char bool;
      | ^~~~~~~
make[3]: *** [Makefile:770: psqlodbcw_la-lobj.lo] Fehler 1
make[3]: *** Es wird auf noch nicht beendete Prozesse gewartet …
In file included from parse.c:25:
psqlodbc.h:300:23: error: 'bool' cannot be defined via 'typedef'
  300 | typedef unsigned char bool;
      |                       ^~~~
psqlodbc.h:300:23: note: 'bool' is a keyword with '-std=c23' onwards
psqlodbc.h:300:1: warning: useless type name in empty declaration
  300 | typedef unsigned char bool;
      | ^~~~~~~
make[3]: *** [Makefile:756: psqlodbcw_la-environ.lo] Fehler 1
@davecramer
Copy link
Contributor

@df7cb is this new due to some recent changes in the odbc code ?

@df7cb
Copy link
Author

df7cb commented Mar 2, 2025

No, this is gcc 15 being stricter/defaulting to -std=c23.

@davecramer
Copy link
Contributor

if test "$ac_cv_header_stdbool_h" = yes -a "$ac_cv_sizeof_bool" = 1; then
is not finding the header or the header doesn't exist ?

@df7cb
Copy link
Author

df7cb commented Mar 2, 2025

$ zgrep -i bool ../log.gz 
checking size of bool... 1
checking for _Bool... yes
checking for stdbool.h that conforms to C99 or later... yes
psqlodbc.h:300:23: error: 'bool' cannot be defined via 'typedef'
  300 | typedef unsigned char bool;
psqlodbc.h:300:23: note: 'bool' is a keyword with '-std=c23' onwards
  300 | typedef unsigned char bool;

@davecramer
Copy link
Contributor

Seems like a problem with configure to me

shr-project added a commit to shr-project/psqlodbc that referenced this issue Apr 22, 2025
before using ac_cv_sizeof_bool

It was called after this conditional, so PG_USE_STDBOOL wasn't set
even when it should be as shown in at the end of config.log:

  ac_cv_header_stdbool_h=yes
  ac_cv_sizeof_bool=1
  ac_cv_type__Bool=yes
  #define SIZEOF_BOOL 1
  #define HAVE__BOOL 1
  #define HAVE_STDBOOL_H 1

* fixes:
  postgresql-interfaces#110
  postgresql-interfaces#94

Signed-off-by: Martin Jansa <[email protected]>
github-actions bot pushed a commit to Boeing/meta-openembedded-contrib that referenced this issue Apr 22, 2025
configure: make sure to call AC_CHECK_HEADER_STDBOOL before using ac_cv_sizeof_bool

It was called after this conditional, so PG_USE_STDBOOL wasn't set
even when it should be as shown in at the end of config.log:

  ac_cv_header_stdbool_h=yes
  ac_cv_sizeof_bool=1
  ac_cv_type__Bool=yes
  #define SIZEOF_BOOL 1
  #define HAVE__BOOL 1
  #define HAVE_STDBOOL_H 1

* fixes:
  postgresql-interfaces/psqlodbc#110
  postgresql-interfaces/psqlodbc#94

http://errors.yoctoproject.org/Errors/Details/852841/

In file included from ../psqlodbc-16.00.0000/environ.h:16,
                 from ../psqlodbc-16.00.0000/environ.c:16:
../psqlodbc-16.00.0000/psqlodbc.h:264:23: error: 'bool' cannot be defined via 'typedef'
  264 | typedef unsigned char bool;
      |                       ^~~~

Signed-off-by: Martin Jansa <[email protected]>
kraj pushed a commit to YoeDistro/meta-openembedded that referenced this issue Apr 22, 2025
configure: make sure to call AC_CHECK_HEADER_STDBOOL before using ac_cv_sizeof_bool

It was called after this conditional, so PG_USE_STDBOOL wasn't set
even when it should be as shown in at the end of config.log:

  ac_cv_header_stdbool_h=yes
  ac_cv_sizeof_bool=1
  ac_cv_type__Bool=yes
  #define SIZEOF_BOOL 1
  #define HAVE__BOOL 1
  #define HAVE_STDBOOL_H 1

* fixes:
  postgresql-interfaces/psqlodbc#110
  postgresql-interfaces/psqlodbc#94

http://errors.yoctoproject.org/Errors/Details/852841/

In file included from ../psqlodbc-16.00.0000/environ.h:16,
                 from ../psqlodbc-16.00.0000/environ.c:16:
../psqlodbc-16.00.0000/psqlodbc.h:264:23: error: 'bool' cannot be defined via 'typedef'
  264 | typedef unsigned char bool;
      |                       ^~~~

Signed-off-by: Martin Jansa <[email protected]>
Signed-off-by: Khem Raj <[email protected]>
kraj pushed a commit to YoeDistro/meta-openembedded that referenced this issue Apr 22, 2025
configure: make sure to call AC_CHECK_HEADER_STDBOOL before using ac_cv_sizeof_bool

It was called after this conditional, so PG_USE_STDBOOL wasn't set
even when it should be as shown in at the end of config.log:

  ac_cv_header_stdbool_h=yes
  ac_cv_sizeof_bool=1
  ac_cv_type__Bool=yes
  #define SIZEOF_BOOL 1
  #define HAVE__BOOL 1
  #define HAVE_STDBOOL_H 1

* fixes:
  postgresql-interfaces/psqlodbc#110
  postgresql-interfaces/psqlodbc#94

http://errors.yoctoproject.org/Errors/Details/852841/

In file included from ../psqlodbc-16.00.0000/environ.h:16,
                 from ../psqlodbc-16.00.0000/environ.c:16:
../psqlodbc-16.00.0000/psqlodbc.h:264:23: error: 'bool' cannot be defined via 'typedef'
  264 | typedef unsigned char bool;
      |                       ^~~~

Signed-off-by: Martin Jansa <[email protected]>
Signed-off-by: Khem Raj <[email protected]>
kraj pushed a commit to YoeDistro/meta-openembedded that referenced this issue Apr 24, 2025
configure: make sure to call AC_CHECK_HEADER_STDBOOL before using ac_cv_sizeof_bool

It was called after this conditional, so PG_USE_STDBOOL wasn't set
even when it should be as shown in at the end of config.log:

  ac_cv_header_stdbool_h=yes
  ac_cv_sizeof_bool=1
  ac_cv_type__Bool=yes
  #define SIZEOF_BOOL 1
  #define HAVE__BOOL 1
  #define HAVE_STDBOOL_H 1

* fixes:
  postgresql-interfaces/psqlodbc#110
  postgresql-interfaces/psqlodbc#94

http://errors.yoctoproject.org/Errors/Details/852841/

In file included from ../psqlodbc-16.00.0000/environ.h:16,
                 from ../psqlodbc-16.00.0000/environ.c:16:
../psqlodbc-16.00.0000/psqlodbc.h:264:23: error: 'bool' cannot be defined via 'typedef'
  264 | typedef unsigned char bool;
      |                       ^~~~

Signed-off-by: Martin Jansa <[email protected]>
Signed-off-by: Khem Raj <[email protected]>
daregit pushed a commit to daregit/yocto-combined that referenced this issue Apr 24, 2025
configure: make sure to call AC_CHECK_HEADER_STDBOOL before using ac_cv_sizeof_bool

It was called after this conditional, so PG_USE_STDBOOL wasn't set
even when it should be as shown in at the end of config.log:

  ac_cv_header_stdbool_h=yes
  ac_cv_sizeof_bool=1
  ac_cv_type__Bool=yes
  #define SIZEOF_BOOL 1
  #define HAVE__BOOL 1
  #define HAVE_STDBOOL_H 1

* fixes:
  postgresql-interfaces/psqlodbc#110
  postgresql-interfaces/psqlodbc#94

http://errors.yoctoproject.org/Errors/Details/852841/

In file included from ../psqlodbc-16.00.0000/environ.h:16,
                 from ../psqlodbc-16.00.0000/environ.c:16:
../psqlodbc-16.00.0000/psqlodbc.h:264:23: error: 'bool' cannot be defined via 'typedef'
  264 | typedef unsigned char bool;
      |                       ^~~~

Signed-off-by: Martin Jansa <martin.jansagmail.com>
Signed-off-by: Khem Raj <raj.khemgmail.com>
davecramer pushed a commit that referenced this issue Apr 24, 2025
before using ac_cv_sizeof_bool

It was called after this conditional, so PG_USE_STDBOOL wasn't set
even when it should be as shown in at the end of config.log:

  ac_cv_header_stdbool_h=yes
  ac_cv_sizeof_bool=1
  ac_cv_type__Bool=yes
  #define SIZEOF_BOOL 1
  #define HAVE__BOOL 1
  #define HAVE_STDBOOL_H 1

* fixes:
  #110
  #94

Signed-off-by: Martin Jansa <[email protected]>
ColinKYuen pushed a commit to aws/aws-pgsql-odbc that referenced this issue Apr 24, 2025
before using ac_cv_sizeof_bool

It was called after this conditional, so PG_USE_STDBOOL wasn't set
even when it should be as shown in at the end of config.log:

  ac_cv_header_stdbool_h=yes
  ac_cv_sizeof_bool=1
  ac_cv_type__Bool=yes
  #define SIZEOF_BOOL 1
  #define HAVE__BOOL 1
  #define HAVE_STDBOOL_H 1

* fixes:
  postgresql-interfaces/psqlodbc#110
  postgresql-interfaces/psqlodbc#94

Signed-off-by: Martin Jansa <[email protected]>
daregit pushed a commit to daregit/yocto-combined that referenced this issue May 5, 2025
configure: make sure to call AC_CHECK_HEADER_STDBOOL before using ac_cv_sizeof_bool

It was called after this conditional, so PG_USE_STDBOOL wasn't set
even when it should be as shown in at the end of config.log:

  ac_cv_header_stdbool_h=yes
  ac_cv_sizeof_bool=1
  ac_cv_type__Bool=yes
  #define SIZEOF_BOOL 1
  #define HAVE__BOOL 1
  #define HAVE_STDBOOL_H 1

* fixes:
  postgresql-interfaces/psqlodbc#110
  postgresql-interfaces/psqlodbc#94

http://errors.yoctoproject.org/Errors/Details/852841/

In file included from ../psqlodbc-16.00.0000/environ.h:16,
                 from ../psqlodbc-16.00.0000/environ.c:16:
../psqlodbc-16.00.0000/psqlodbc.h:264:23: error: 'bool' cannot be defined via 'typedef'
  264 | typedef unsigned char bool;
      |                       ^~~~

Signed-off-by: Martin Jansa <martin.jansagmail.com>
Signed-off-by: Khem Raj <raj.khemgmail.com>
daregit pushed a commit to daregit/yocto-combined that referenced this issue May 6, 2025
configure: make sure to call AC_CHECK_HEADER_STDBOOL before using ac_cv_sizeof_bool

It was called after this conditional, so PG_USE_STDBOOL wasn't set
even when it should be as shown in at the end of config.log:

  ac_cv_header_stdbool_h=yes
  ac_cv_sizeof_bool=1
  ac_cv_type__Bool=yes
  #define SIZEOF_BOOL 1
  #define HAVE__BOOL 1
  #define HAVE_STDBOOL_H 1

* fixes:
  postgresql-interfaces/psqlodbc#110
  postgresql-interfaces/psqlodbc#94

http://errors.yoctoproject.org/Errors/Details/852841/

In file included from ../psqlodbc-16.00.0000/environ.h:16,
                 from ../psqlodbc-16.00.0000/environ.c:16:
../psqlodbc-16.00.0000/psqlodbc.h:264:23: error: 'bool' cannot be defined via 'typedef'
  264 | typedef unsigned char bool;
      |                       ^~~~

Signed-off-by: Martin Jansa <martin.jansagmail.com>
Signed-off-by: Khem Raj <raj.khemgmail.com>
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

2 participants