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

Wrong C++ version check for span_HAVE_NORETURN? #83

Closed
simark opened this issue Feb 2, 2024 · 3 comments
Closed

Wrong C++ version check for span_HAVE_NORETURN? #83

simark opened this issue Feb 2, 2024 · 3 comments

Comments

@simark
Copy link

simark commented Feb 2, 2024

Compiling as C++11, I see:

/home/smarchi/src/babeltrace/src/cpp-common/vendor/span-lite/span.hpp:831:1: error: function 'throw_out_of_range' could be declared with attribute 'noreturn' [-Werror,-Wmissing-noreturn]
  831 | {
      | ^
/home/smarchi/src/babeltrace/src/cpp-common/vendor/span-lite/span.hpp:854:1: error: function 'report_contract_violation' could be declared with attribute 'noreturn' [-Werror,-Wmissing-noreturn]
  854 | {
      | ^

The definition of span_HAVE_NORETURN is:

 #define span_HAVE_NORETURN                  span_CPP17_000

cppreference says it's available in C++11:

https://en.cppreference.com/w/cpp/language/attributes/noreturn

So I guess the definition of span_HAVE_RETURN should be span_CPP11_OR_GREATER or one of the span_CPP11_* ones. I have no idea about the support of MSVC for this, unfortunately.

@eepp
Copy link

eepp commented Feb 4, 2024

@martinmoene Would you mind making a new release including this fix?

We include your projects directly into ours and I prefer referring to a specific version/tag.

@martinmoene
Copy link
Owner

@eepp Yeah, I'll do that, thanks for the heads-up.

@martinmoene
Copy link
Owner

@eepp Created release 0.11.0; notes yet to be edited.

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

3 participants