Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add c99 flag for compiling on Ruby 2 #895

Merged
merged 1 commit into from
Feb 3, 2022
Merged

Conversation

castwide
Copy link
Contributor

@castwide castwide commented Feb 2, 2022

The native extension fails to compile on Ruby 2.6/7 with errors like the following:

../../../../ext/rbs_extension/parserstate.c:77:5: error: ‘for’ loop initial declarations are only allowed in C99 mode
     for (size_t i = 0; i < table->count; i++) {
     ^
../../../../ext/rbs_extension/parserstate.c:77:5: note: use option -std=c99 or -std=gnu99 to compile your code

This PR adds -std=c99 to $CFLAGS to enforce C99 mode.

Tested locally on Ruby 2.6.3, 2.7.2, and 3.0.1.

Copy link
Member

@soutaro soutaro left a comment

Choose a reason for hiding this comment

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

Thanks! 👏

@soutaro soutaro merged commit b146ce3 into ruby:master Feb 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants