wasm2c: Remove enum types from variadic get_func_type API #2588
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Enum types in variadic functions aren't guaranteed to work. This is because enums for variadics undergo default argument promotion (promotion to int), and thus the user of
va_argshould always get the argument as anint. Thus enums in varargs function would break on any compiler whose underlying representation is not an int (e.g., when using gcc's-fshort-enumsflag)https://stackoverflow.com/questions/73278375/do-enum-types-undergo-default-argument-promotion
https://stackoverflow.com/questions/24580503/error-when-pass-enum-in-a-function-with-variable-arguments/24580800#24580800
This pattern is used in the get_func_type function emitted as part of wasm2c modules. This PR changes this API to always use
intfor the var args.