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

Fix function parameters to support C23 #66

Merged
merged 1 commit into from
Jan 16, 2025

Conversation

mtasaka
Copy link
Contributor

@mtasaka mtasaka commented Jan 15, 2025

C23 regards function prototype with no parameter list as that with taking no parameter (i.e. func(void)).

Esplicitly write parameter list to support C23.

Closes #65 .

@mtasaka
Copy link
Contributor Author

mtasaka commented Jan 15, 2025

As I wrote in #65 , there are many functions with K&R style in tcltk.c, however I don't think we no longer have to support K&R style.

@jeremyevans
Copy link
Contributor

I would like to have ruby-tk build with C23, but we need to ensure compatibility with older compilers as well. I've enabled the CI build for this PR, but the fail-fast makes it difficult to debug. I'll push a change to disable fail-fast.

@jeremyevans
Copy link
Contributor

If you rebase this on master, it should will turn off the fail-fast code, and you can see if the issue affects just ruby-head, or all ruby versions.

C23 regards function prototype with no parameter list as
that with taking no parameter (i.e. `func(void)`).

Esplicitly write parameter list to support C23.

Closes ruby#65 .
@mtasaka
Copy link
Contributor Author

mtasaka commented Jan 16, 2025

The above CI failure is due to identifier omission in function definition which is C23 feature not in C17, I modified a patch a bit.

@jeremyevans
Copy link
Contributor

CI looks good now. Are you aware of any issues with this patch building on compilers that only support C99 (this is the C version Ruby targets, and ruby-tk should also build with it)?

@mtasaka
Copy link
Contributor Author

mtasaka commented Jan 16, 2025

C99 should be okay with my patch (this PR).

BTW if C99 is the lowest target ruby-tk (and ruby) should support, I think (after this PR is merged) we can clean up K&R style function declaration.

@jeremyevans
Copy link
Contributor

C99 should be okay with my patch (this PR).

OK. I'll merge this shortly.

BTW if C99 is the lowest target ruby-tk (and ruby) should support, I think (after this PR is merged) we can clean up K&R style function declaration.

Yes, that would be a good improvement.

@jeremyevans jeremyevans merged commit 9c27cd3 into ruby:master Jan 16, 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
Development

Successfully merging this pull request may close these issues.

tk 0.5.1 not C23 ready
2 participants