Bug 2336449

Summary: cbmc fails to build with GCC 15 (C23?)
Product: [Fedora] Fedora Reporter: Dave Malcolm <dmalcolm>
Component: cbmcAssignee: Lukáš Zaoral <lzaoral>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 42CC: kdudka, lzaoral, releng, vmihalko
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: cbmc-6.5.0-1.fc43 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2025-04-24 12:35:24 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 2260875, 2300528, 2333037    

Description Dave Malcolm 2025-01-08 20:05:29 UTC
I'm experimentally rebuilding rawhide with the not-yet-released GCC 15 to see if anything breaks, and to help write the porting guide.  See https://fedoraproject.org/wiki/User:Dmalcolm/gcc-15

My test build with GCC 15 failed on x86_64:
https://copr.fedorainfracloud.org/coprs/dmalcolm/gcc-15-smoketest-3.failed/build/8476160/

whereas my test build with GCC 14 succeeded:
https://copr.fedorainfracloud.org/coprs/dmalcolm/gcc-15-smoketest-3.failed.checker/build/8478154/

Looking at the failure log
https://download.copr.fedorainfracloud.org/results/dmalcolm/gcc-15-smoketest-3.failed/fedora-rawhide-x86_64/08476160-cbmc/builder-live.log.gz
I see various errors, such as:

Tests failed
  4 of 252 tests failed, 19 tests skipped


Failed test: Header_files1/test.desc
/usr/lib/gcc/x86_64-redhat-linux/15/include/stddef.h:450:1: error: failed to find symbol 'nullptr'
   typedef __typeof__(nullptr) nullptr_t;
CONVERSION ERROR

EXIT=1
SIGNAL=0



Failed Header_files1/test.desc lines:
^EXIT=0$ [FAILED]
^CONVERSION ERROR$ [FAILED]


Failed test: gcc_builtins6/test.desc
/usr/lib/gcc/x86_64-redhat-linux/15/include/stddef.h:450:1: error: failed to find symbol 'nullptr'
   typedef __typeof__(nullptr) nullptr_t;
CONVERSION ERROR

EXIT=1
SIGNAL=0



Failed gcc_builtins6/test.desc lines:
^EXIT=0$ [FAILED]
^CONVERSION ERROR$ [FAILED]


Failed test: human-readable-error-on-wrong-main-signature/test.desc
/usr/lib/gcc/x86_64-redhat-linux/15/include/stddef.h:450:1: error: failed to find symbol 'nullptr'
   typedef __typeof__(nullptr) nullptr_t;
CONVERSION ERROR

EXIT=1
SIGNAL=0



Failed human-readable-error-on-wrong-main-signature/test.desc lines:
'main' with signature .* found [FAILED]


Failed test: linking_contracts1/test.desc
header.h: In function 'bool':
header.h:3:1: error: syntax error before 'util_func'
 bool util_func(int a)
PARSING ERROR

This might be due to GCC 15 now defaulting to -std=gnu23, whereas GCC 14 defaulted to -std=gnu17, and:
* C23 is stricter about function prototypes than C17
* there are various new keywords in C23, including "bool"





Reproducible: Always

Comment 1 Aoife Moloney 2025-02-26 13:21:53 UTC
This bug appears to have been reported against 'rawhide' during the Fedora Linux 42 development cycle.
Changing version to 42.

Comment 2 Lukáš Zaoral 2025-04-23 08:13:54 UTC
This should be resolved by the following upstream PRs:
* https://github.com/diffblue/cbmc/pull/8620
* https://github.com/diffblue/cbmc/pull/8623

Comment 3 Lukáš Zaoral 2025-04-23 08:14:46 UTC
*** Bug 2339958 has been marked as a duplicate of this bug. ***