Re: Bash fails to compile with GCC 15 / C23 due to bool typedef in basha
From:
Chet Ramey
Subject:
Re: Bash fails to compile with GCC 15 / C23 due to bool typedef in bashansi.h
Date:
Fri, 28 Nov 2025 12:14:42 -0500
User-agent:
Mozilla Thunderbird
On 11/27/25 11:03 AM, hao a wrote:
Hello,
When building Bash on Ubuntu with GCC 15 using C23, the build fails because
bashansi.h attempts to typedef bool, which is a keyword in C23.
You don't say which version of bash you're using, but I'll assume bash-5.3.
*Environment:*
gcc (Ubuntu 15.2.0-4ubuntu4) 15.2.0
Linux u25 6.17.0-6-generic x86_64 GNU/Linux
*Error log:*
../bashansi.h:44:23: error: ‘bool’ cannot be defined via ‘typedef’
note: ‘bool’ is a keyword with ‘-std=c23’ onwards
make[1]: *** [Makefile:231: mkbuiltins.o] Error 1
I would be more interested in why the autoconf macro that tests for the
presence of `bool', `true', and `false' produced a false negative. Check
for `bool' in config.log.
Chet
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU chet@case.edu http://tiswww.cwru.edu/~chet/