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.

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.

None yet

1 participant