Bug 2342124 - bool is a keyword in C23
Summary: bool is a keyword in C23
Keywords:
Status: NEW
Alias: None
Product: Fedora
Classification: Fedora
Component: id3lib
Version: 44
Hardware: Unspecified
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: David King
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: 2339957
TreeView+ depends on / blocked
 
Reported: 2025-01-26 10:18 UTC by Göran Uddeborg
Modified: 2026-05-17 20:08 UTC (History)
3 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed:
Type: ---
Embargoed:


Attachments (Terms of Use)
id3lib-3.8.3-61.fc43.src.rpm (967.43 KB, application/x-rpm)
2025-05-21 07:11 UTC, Adrian Reber
no flags Details

Description Göran Uddeborg 2025-01-26 10:18:49 UTC
In C23 "bool" became a keyword, which makes the typedef int bool in /usr/include/id3/globals.h invalid. It is already excluded if __cplusplus is defined. It also needs to be excluded if __STDC_VERSION__ is defined and greater than or equal to 202311L.

Reproducible: Always

Steps to Reproduce:
1. Create this test file as c.c:
#include <id3/globals.h>
int i;
2. gcc -c c.c

Actual Results:  
In file included from c.c:1:
/usr/include/id3/globals.h:87:13: error: ‘bool’ cannot be defined via ‘typedef’
   87 | typedef int bool;
      |             ^~~~
/usr/include/id3/globals.h:87:13: note: ‘bool’ is a keyword with ‘-std=c23’ onwards


Expected Results:  
Successful compilation

I've created an upstreams report, but upstreams seems more or less dead so I guess we will have to carry the trivial patch for this.

Comment 1 Göran Uddeborg 2025-01-26 10:20:28 UTC
Upstreams bug report: https://sourceforge.net/p/id3lib/bugs/215/

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

Comment 3 Adrian Reber 2025-05-21 07:10:52 UTC
Following fix seems to work for:

$ cat bool-typedef.patch
--- a/include/id3/globals.h.orig	2025-05-21 08:42:57.016903897 +0200
+++ b/include/id3/globals.h	2025-05-21 08:43:22.341728964 +0200
@@ -84,9 +84,11 @@
 
 #ifndef __cplusplus
 
+#if !defined(__STDC_VERSION__) || __STDC_VERSION__ < 202311L
 typedef int bool;
 #  define false (0)
 #  define true (!false)
+#endif
 
 #endif /* __cplusplus */
 

I am attaching an SRPM with this fix. Maybe you could try it.

Comment 4 Adrian Reber 2025-05-21 07:11:43 UTC
Created attachment 2090976 [details]
id3lib-3.8.3-61.fc43.src.rpm

Comment 5 Fedora Release Engineering 2026-05-06 12:24:41 UTC
This message is a reminder that Fedora Linux 42 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora Linux 42 on 2026-05-13.
It is Fedora's policy to close all bug reports from releases that are no longer
maintained. At that time this bug will be closed as EOL if it remains open with a
'version' of '42'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, change the 'version' 
to a later Fedora Linux version. Note that the version field may be hidden.
Click the "Show advanced fields" button if you do not see it.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora Linux 42 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora Linux, you are encouraged to change the 'version' to a later version
prior to this bug being closed.

Comment 6 Göran Uddeborg 2026-05-17 20:08:08 UTC
The problem remains in F44, id3lib-devel-3.8.3-62.fc44

The upstreams bug is still open. Using Adrian's above patch in Fedora until upstreams acts would be advantageous.


Note You need to log in before you can comment on or make changes to this bug.