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

Warning for duplicate define of MRB_ARY_NO_EMBED #5520

Closed
lopopolo opened this issue Aug 5, 2021 · 0 comments
Closed

Warning for duplicate define of MRB_ARY_NO_EMBED #5520

lopopolo opened this issue Aug 5, 2021 · 0 comments

Comments

@lopopolo
Copy link
Contributor

lopopolo commented Aug 5, 2021

mruby disables inline arrays for 32-bit architectures:

#if defined(MRB_32BIT) && defined(MRB_NO_BOXING) && !defined(MRB_USE_FLOAT32)
# define MRB_ARY_NO_EMBED
# define MRB_ARY_EMBED_LEN_MAX 0
#else
# define MRB_ARY_EMBED_LEN_MAX ((mrb_int)(sizeof(void*)*3/sizeof(mrb_value)))
mrb_static_assert(MRB_ARY_EMBED_LEN_MAX > 0, "MRB_ARY_EMBED_LEN_MAX > 0");
#endif

I've been -DMRB_ARY_NO_EMBED in my own builds of mruby.

This set of #defines does not check whether MRB_ARY_NO_EMBED is already defined, which leads to a build warning on clang:

warning: /Users/lopopolo/dev/artichoke/playground/target/wasm32-unknown-emscripten/release/build/artichoke-backend-61ddbc16c386408b/out/artichoke-mruby/mruby/include/mruby/array.h:25:10: warning: 'MRB_ARY_NO_EMBED' macro redefined [-Wmacro-redefined]
warning: # define MRB_ARY_NO_EMBED
warning:          ^
warning: <command line>:12:9: note: previous definition is here
warning: #define MRB_ARY_NO_EMBED 1
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

No branches or pull requests

1 participant