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

C API: Fix parameter type for compilation mode configuration #1296

Merged
merged 1 commit into from
Nov 7, 2024

Conversation

turbolent
Copy link
Contributor

Compiling against the current header produces:

# github.com/onflow/wasmi-go
In file included from ./config.go:4:
In file included from ./wasmi/include/wasmi.h:5:
./wasmi/include/wasmi/config.h:124:43: error: type specifier missing, defaults to 'int'; ISO C99 and later do not support implicit int [-Wimplicit-int]
  124 | WASMI_CONFIG_PROP(void, compilation_mode, wasmi_compilation_mode_enum)
      |                                           ^
      |                                           int
./wasmi/include/wasmi/config.h:17:66: note: expanded from macro 'WASMI_CONFIG_PROP'
   17 |   WASM_API_EXTERN ret wasmi_config_##name##_set(wasm_config_t *, ty);
      |

Fix the parameter type by adding the missing enum keyword. Alternatively maybe add a typedef for wasmi_compilation_mode_enum.

@turbolent
Copy link
Contributor Author

BTW, the comment for the function is also wrong (says " Whether or not to floating Wasm point types and operations are enabled." atm)

Copy link

codecov bot commented Nov 7, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 81.59%. Comparing base (68205d4) to head (8bb4b3b).
Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1296    /-   ##
=======================================
  Coverage   81.59%   81.59%           
=======================================
  Files         306      306           
  Lines       25308    25308           
=======================================
  Hits        20649    20649           
  Misses       4659     4659           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Robbepop
Copy link
Member

Robbepop commented Nov 7, 2024

Fix the parameter type by adding the missing enum keyword. Alternatively maybe add a typedef for wasmi_compilation_mode_enum.

What would you say is a better practice in C headers?

@Robbepop
Copy link
Member

Robbepop commented Nov 7, 2024

@turbolent Thanks a lot for the fix!

@Robbepop Robbepop merged commit 7a302a9 into wasmi-labs:main Nov 7, 2024
19 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