- Sponsor
-
Notifications
You must be signed in to change notification settings - Fork 380
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
Remove designated array initializers in rz_analysis.h
#3876
Conversation
ced25a5
to
4a9e550
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure this is the right fix...
It's better to fix the MSVC C++ compilation of the rz_analysis.h
instead.
The culprit seems to be in this code: minimal example on Compiler Explorer |
Discussion continued on Mattermost: https://im.rizin.re/rizinorg/pl/4gn8eymqupbtjnr9rahd1stzwc. |
Please undo the split and fix the MSVC build, preferably with adding MSVC C++ CI job too, then we can merge. |
125fd68
to
af27b59
Compare
RzAnalysisOpType
in a different fileThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-format
complains:
Formatting [1277/1629] librz/include/rz_analysis.h
librz/include/rz_analysis.h:717:26: error: code should be clang-formatted [-Wclang-format-violations]
RZ_ANALYSIS_VAR_KIND_END ///< Number of RzAnalysisVarKind enums
^
librz/include/rz_analysis.h:734:28: error: code should be clang-formatted [-Wclang-format-violations]
RZ_ANALYSIS_VAR_ORIGIN_END ///< Number of RzAnalysisVarOriginKind enums
^
rz_analysis.h
Will remove the draft status after the PR for adding the CI gets merged. |
What PR? |
I'm working on it 😅 |
To be honest, I think it's better to add the CI job in the same PR since it will be red on the |
Alright, makes sense! |
819ee5c
to
4dd63d4
Compare
* Need to test whether Rizin headers can be included in C++ when using MSVC, needed for Cutter to build successfully * Changed the name of `build-cpp` CI job in GitHUb jobs to `build-cpp-linux` to make it obvious that it only performs the test for Linux
4dd63d4
to
6ae791b
Compare
I have only enabled the C++ build test for VS2022, should I also enable it for |
* Do not use designater array initializer because MSVC complains * Add new Appveyor CI test for including C headers from C++ files * Need to test whether Rizin headers can be included in C++ when using MSVC, needed for Cutter to build successfully * Changed the name of `build-cpp` CI job in GitHUb jobs to `build-cpp-linux` to make it obvious that it only performs the test for Linux
Your checklist for this pull request
Detailed description
Removed designated array initializers from the code. MSVC C++ compiler seems to not be able to compile it since it is a C99 thing, and MSVC C++ does not entirely support C99.
MCVE: https://godbolt.org/z/af3v7rWfh.
Also added a new test in Appveyor for testing inclusion of Rizin headers in C++ files. The test is only enabled for VS2022.
Test plan
The new CI for compiling the Rizin headers included in a C++ passes succesfully, and green CI.
Closing issues
Fixes the build for rizinorg/cutter#3247.
(Ignore the branch name)