Skip to content

Use append_cflags instead of modifying CFLAGS directly#29

Merged
cabo merged 2 commits intocabo:masterfrom
stanhu:sh-fix-issue-27
Aug 2, 2025
Merged

Use append_cflags instead of modifying CFLAGS directly#29
cabo merged 2 commits intocabo:masterfrom
stanhu:sh-fix-issue-27

Conversation

@stanhu
Copy link
Contributor

@stanhu stanhu commented Jul 23, 2025

This fixes a compilation issue in GCC 15 due stdbool.h not being included when -std=c99 is in use. This occurs because the standard configure script shipped with Ruby does not properly test for stdbool.h on C23 compilers (https://bugs.ruby-lang.org/issues/21340). It needs to pick up this change:

https://cgit.git.savannah.gnu.org/cgit/autoconf.git/commit/?id=6dcecb780a69bd208088d666b299e92aa7ae7e80

The append_cflags approach is recommended over modifying CFLAGS since it ensures compatibility across different build environments by checking whether the flag is acceptable.

Similar changes:

Closes #27

This was referenced Jul 23, 2025
This fixes a compilation issue in GCC 15 due `stdbool.h`
not being included when `-std=c99` is in use. This occurs because
the standard `configure` script shipped with Ruby does not properly
test for `stdbool.h` on C23 compilers. It needs to pick up this change:

https://cgit.git.savannah.gnu.org/cgit/autoconf.git/commit/?id=6dcecb780a69bd208088d666b299e92aa7ae7e80

The `append_cflags` approach is recommended over modifying CFLAGS since
it ensures compatibility across different build environments by checking
whether the flag is acceptable.

Similar changes:

* socketry/io-event#137
* mongodb/bson-ruby#355

Closes cabo#27
@stanhu stanhu force-pushed the sh-fix-issue-27 branch from 1729ac2 to f948f4e Compare July 28, 2025 13:54
@stanhu
Copy link
Contributor Author

stanhu commented Jul 29, 2025

@cabo Would you mind reviewing this? Thank you!

@cabo
Copy link
Owner

cabo commented Jul 30, 2025

@cabo Would you mind reviewing this? Thank you!

Still on vacation this week. Planning to do this this weekend.
Thank you all for preparing this!

@cabo cabo merged commit 4608d43 into cabo:master Aug 2, 2025
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.

Gem not compatible with gcc 15

3 participants