Skip to content

Add _Bool support to TAU_OVERLOAD_PRINTER for GCC compatibility#60

Merged
jasmcaus merged 1 commit into
jasmcaus:devfrom
Moschn:fix-gcc-bool
Jan 28, 2026
Merged

Add _Bool support to TAU_OVERLOAD_PRINTER for GCC compatibility#60
jasmcaus merged 1 commit into
jasmcaus:devfrom
Moschn:fix-gcc-bool

Conversation

@Moschn

@Moschn Moschn commented Jan 28, 2026

Copy link
Copy Markdown
Contributor

This PR fixes a compilation error encountered when using GCC (specifically aarch64-linux-gnu-gcc in my case) to assert boolean values.

When using CHECK_EQ (or other macros) on a function returning a bool or a boolean literal, GCC fails to select a matching type in the _Generic association within TAU_OVERLOAD_PRINTER. This results in the following error:

error: '_Generic' selector of type '_Bool' is not compatible with any association

This happens because _Bool is a distinct type in C11, and without an explicit entry in the generic selection, it doesn't fall back to int or unsigned int automatically in this context.

GCC requires an explicit association for _Bool in C11 _Generic selections. Without this, assertions on boolean values fail to compile with:
"error: '_Generic' selector of type '_Bool' is not compatible with any association"

This change maps _Bool to the "%d" format specifier.
@Moschn Moschn requested a review from jasmcaus as a code owner January 28, 2026 16:36
@jasmcaus jasmcaus merged commit 4ffa763 into jasmcaus:dev Jan 28, 2026
13 of 87 checks passed
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

Successfully merging this pull request may close these issues.

2 participants