Skip to content

Fix compile error due to more strict function argument syntax in C23#100

Merged
tmm1 merged 1 commit intotmm1:masterfrom
nullchristo:gcc15-c23-build-fix
May 13, 2025
Merged

Fix compile error due to more strict function argument syntax in C23#100
tmm1 merged 1 commit intotmm1:masterfrom
nullchristo:gcc15-c23-build-fix

Conversation

@nullchristo
Copy link
Contributor

Ran into a build issue when trying to install this gem after compiling Ruby with GCC 15, which defaults to the C23 standard.

C23 is more strict about functions without arguments actually having no arguments.

The rb_data_type_t struct expects a the dmark function to have a single void* arg, so I updated the signature of the rb_gc_mark function.

@nullchristo nullchristo changed the title Fix error due to more strict function argument syntax in C23 Fix compile error due to more strict function argument syntax in C23 May 13, 2025
#ifdef __FreeBSD__
#define PLATFORM_FREEBSD
#elif __OpenBSD__
#elif defined __OpenBSD__
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Quiets a compile warning over OpenBSD not existing

} else if (rbtracer.num > 0) {
// tracing only specific methods
int i, n;
unsigned int i, n;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Quiets a compile warning over comparing signed/unsigned ints.

@tmm1 tmm1 merged commit 476fe19 into tmm1:master May 13, 2025
5 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