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

Avoid warnings in compiler version checks #2781

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mnijhuis-tos
Copy link

GCC 13 may give warnings like:

/home/maik/scratch/schaap/everybeam/include/xtensor/xutils.hpp:33:6: error: "_MSC_VER" is not defined, evaluates to 0 [-Werror=undef]
   33 | #if (_MSC_VER >= 1910)
      |      ^~~~~~~~
In file included from /home/maik/scratch/schaap/everybeam/include/xtensor/xcontainer.hpp:25,
                 from /home/maik/scratch/schaap/everybeam/include/xtensor/xtensor.hpp:20:
/home/maik/scratch/schaap/everybeam/include/xtensor/xmath.hpp:1077:69: error: "GCC_VERSION" is not defined, evaluates to 0 [-Werror=undef]
 1077 | #if (defined(_MSC_VER) && _MSC_VER < 1910) || (defined(__GNUC__) && GCC_VERSION < 49999)
      |                                                                     ^~~~~~~~~~~

This PR avoids these warnings by

  • Adding a check if _MSC_VER is defined.
  • Avoiding using GCC_VERSION, since checking against GNUC should suffice.

@aroffringa aroffringa mentioned this pull request Aug 1, 2024
4 tasks
@aroffringa
Copy link

This looks like a nice small PR that would solve already a lot of warnings that I get. Could this PR be merged?

I addressed the same warnings in #2801, as well as a few more, so this PR has a lower threshold to merge. If this gets merged I'll rebase my branch so that it only addresses the warnings not yet covered here.

@aroffringa
Copy link

@JohanMabille can you maybe merge this PR?

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 this pull request may close these issues.

2 participants