Build failure with GCC 15 (defaults to -std=gnu23) - Mailing list pgsql-bugs

From Sam James
Subject Build failure with GCC 15 (defaults to -std=gnu23)
Date
Msg-id 87o72eo9iu.fsf@gentoo.org
Whole thread Raw
Responses Re: Build failure with GCC 15 (defaults to -std=gnu23)
List pgsql-bugs
Hi,

postgres-17.1 fails to build with upcoming GCC 15 which defaults to
-std=gnu23 as follows:
```
In file included from ../../src/include/postgres_fe.h:25,
                 from checksum_helper.c:17:
../../src/include/c.h:456:23: error: two or more data types in declaration specifiers
  456 | typedef unsigned char bool;
      |                       ^~~~
../../src/include/c.h:456:1: warning: useless type name in empty declaration
  456 | typedef unsigned char bool;
      | ^~~~~~~
```

src/include/c.h does attempt to check for whether bool is already defined but
the check doesn't work.

There may be more issues afterwards but I haven't tried papering over
the above issue. It should be possible to reproduce w/
CFLAGS="... -std=gnu23" or CFLAGS="... -std=c23" on older GCC or Clang.

thanks,
sam



pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: Today's Postgres Releases break login roles
Next
From: Alexander Lakhin
Date:
Subject: Re: BUG #18708: regex problem: (?:[^\d\D]){0} asserts with "lp->nouts == 0 && rp->nins == 0"