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

Use of debugbreak should be opt-in #362

Closed
svart-riddare opened this issue Mar 31, 2023 · 3 comments · Fixed by #411
Closed

Use of debugbreak should be opt-in #362

svart-riddare opened this issue Mar 31, 2023 · 3 comments · Fixed by #411

Comments

@svart-riddare
Copy link

There are two minor issues when including yml.hpp, when using sources from the 0.5.0 tag:

  • I have to #define C4_NO_DEBUG_BREAK before inclusion otherwise in c4core (tag 0.11.0), a non-existing header c4/ext/debugbreak.h is included.
  • I have to #pragma GCC diagnostic ignored "-Wold-style-cast" to inhibit some g++ warnings.

While writing this ticket, I realized that the tar.gz of c4core 0.11.0 available on github does not contain files from external repositories, explaining why the header is missing. You may thus ignore this part (but why would a yaml library call __debugbreak ?).

For the second part, using -Wno-old-style-cast is of course specific to my project, but maybe others will use it and I have seen code to disable some warnings in rapidyaml, so maybe you will want to add this one.

Regards

@biojppm
Copy link
Owner

biojppm commented Mar 31, 2023

the tar.gz of c4core 0.11.0 available on github does not contain files from external repositories

When a release is made, the auto-generated source tarball from github unfortunately never includes submodule repos. So you need to pick a different file to get a properly working source tarball:

image

This also applies to the rapidyaml repo. If you pick the equivalent rapidyaml file, it will bring the c4core source, and there's no reason for you to have to get c4core separately.

but why would a yaml library call __debugbreak ?

Fair point.

rapidyaml uses c4core, and c4core provides/uses debugbreak in debug builds. I chose to put it as opt-out because I use it heavily when debugging. In release builds, it goes away (and if it doesn't that's a bug), which is generally what most users will be looking for. So I never found it to be on my way.

However, on hindsight, I agree that it should be opt-in. I will revise that, and leave this issue open to track that.

For the C-cast warnings, let's track it in a different issue.

@biojppm biojppm changed the title Minor issues when including yml.hpp Use of debugbreak should be opt-in Mar 31, 2023
@biojppm
Copy link
Owner

biojppm commented Mar 31, 2023

  • I have to #pragma GCC diagnostic ignored "-Wold-style-cast" to inhibit some g++ warnings.

@svart-riddare
Copy link
Author

Thank you for the explanation about the tar files.

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

Successfully merging a pull request may close this issue.

2 participants