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 undeclared function rb_mmtk_enabled_p when compiling #63

Merged

Conversation

eileencodes
Copy link
Collaborator

@eileencodes eileencodes commented Apr 10, 2024

I noticed that in CI and locally the mmtk branch wasn't compiling and failing on the following compilation errors:

gc.c:10074:9: error: call to undeclared function 'rb_mmtk_enabled_p'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
    if (rb_mmtk_enabled_p()) {
        ^
error.c:1076:39: error: call to undeclared function 'rb_mmtk_enabled_p'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
    if (rb_current_execution_context(!rb_mmtk_enabled_p())) {
                                      ^

The internal/mmtk_support.h header is included fine, but these two lines were using ifdef USE_MMTK rather than if USE_MMTK. Changing these allows CRuby mmtk branch to get past these compilation errors.

See https://github.com/mmtk/ruby/actions/runs/8416953029/job/23044511739 for an example of these errors.

I noticed that in CI and locally the `mmtk` branch wasn't compiling and
failing on the following compilation errors:

```
gc.c:10074:9: error: call to undeclared function 'rb_mmtk_enabled_p'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
    if (rb_mmtk_enabled_p()) {
        ^
```

```
error.c:1076:39: error: call to undeclared function 'rb_mmtk_enabled_p'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
    if (rb_current_execution_context(!rb_mmtk_enabled_p())) {
                                      ^
```

The `internal/mmtk_support.h` header is included fine, but these two
lines were using `ifdef USE_MMTK` rather than `if USE_MMTK`. Changing
these allows CRuby mmtk branch to compile correctly.
@eileencodes
Copy link
Collaborator Author

eileencodes commented Apr 10, 2024

Merging master fixes the remaining compilation errors I'm seeing locally. Happy to send a PR for that as I've already fixed the conflicts. I'm not sure how this repo prefers to sync with upstream.

Actually we need this change too, then it compiles #64

@wks
Copy link

wks commented Apr 11, 2024

That must be a typo. We used to use #ifdef USE_MMTK, but switched to #if USE_MMTK later.

@wks wks merged commit 5f5aa4f into mmtk:mmtk Apr 11, 2024
1 check passed
@eileencodes eileencodes deleted the fix-undeclared-function-rb_mmtk_enabled_p branch April 11, 2024 12:42
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