-
Notifications
You must be signed in to change notification settings - Fork 539
C++ compiler issues with generated code #437
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
Thanks! Couple comments. Few of these (1, 3, and 6) are good cleanup and would be great for a PR. Feel free to submit it.
|
Also, 2 and 4 are a pending PR in #384 |
Thanks for the quick reply, ignore item 3. That was my own earlier mistake in trying to solve 2. For 4, I have the java code determine if it's sensible to generate C++ code for the comparison. When the type minimum coincides with the number in group minimum then that term of the comparison expression is not generated. When the type maximum coincides with the number in group maximum, then that term of the comparison expression is not generated. If neither term is generated, then no comparison expression is generated at all. For 5, if the relevant constexpr method XSinceVersion would return zero, then the boolean expression would always be true so the XInActingVersion always returns true. I believe this to be generally correct, but I may have missed something. If that's an acceptable modification I'll create a pull request just for those changes. |
@DanielDylan go ahead and create a PR if you wish. |
Is 5. why I have a warning for every For example:
|
@ccge some other flags warn have been turned on when they encounter pragmas they do not understand. These can be safely ignored if using gcc. |
@tmontgomery The warnings spilled out at me as well on Windows against MSVC. Would it make sense to use compiler tests to guard against these compiler-specific
We may need to add the compiler checks like the following.
|
@nauhygon probably OK to simply inline the compiler checks as it is being generated anyway. |
@tmontgomery Like this? If the changes look fine to you, I am going to submit a PR. Thanks! |
Yeah, this looks fine. Send a PR and I will check into it. Thanks! |
Partial fix for #437: Use compiler detections to guard pragmas to suppress excessive warnings
Firstly thank you for providing this code as open source.
I have found some issues with the C++ generated code:
I have forked your code and added a C++11 generator (C11Generator.java) which fixes the above, but it would be more widely beneficial if it was co-ordinated with your CppGenerator.
Happy to discuss further.
Thank you
Dany
The text was updated successfully, but these errors were encountered: