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

Building with gcc toolchain and C++ API produces lots of warnings #3618

Open
lutter opened this issue Apr 19, 2017 · 2 comments
Open

Building with gcc toolchain and C++ API produces lots of warnings #3618

lutter opened this issue Apr 19, 2017 · 2 comments

Comments

@lutter
Copy link

lutter commented Apr 19, 2017

When I try to build mruby and use conf.enable_cxx_abi, the compiler emits lots of warnings of the form

CC    src/range.c -> build/host/src/range.o
cc1plus: warning: command line option ‘-Wdeclaration-after-statement’ is valid for C/ObjC but not for C++
cc1plus: warning: command line option ‘-std=gnu99’ is valid for C/ObjC but not for C++

The problem seems to be that enable_cxx_abi simply appends the cxx_compile_flag options to the normal compiler options resulting in conflicting compiler flags. I am not quite sure what the best way to fix this would be.

It also seems that with the way enable_cxx_abi is currently done, it makes it impossible for mrbgems to compile anything as plain C. It looks like that is a problem e.g. for mruby-onig-regexp which needs to compile the bundled onigmo as C, not C++, even if C++ ABI is enabled.

I am on Fedora 25 with gcc 6.3.1.

@matz
Copy link
Member

matz commented Apr 19, 2017

I understand the issue but have no idea to fix it. Besides that, it's an only warning issue with low priority to fix.

@lutter
Copy link
Author

lutter commented Apr 19, 2017

Thanks for the quick reply - I agree that it's mostly cosmetic at this point. If I'll figure something out, I'll post something here.

matz added a commit that referenced this issue Sep 13, 2019
…tion-with-enable_cxx_abi

Fix warnings for invalid C++ option with `enable_cxx_abi`; ref #3618, #4703
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

2 participants