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 Wzero-as-null-pointer-constant warning #75

Merged
merged 1 commit into from
May 11, 2023

Conversation

Flamefire
Copy link
Contributor

Newer compilers may warn when using 0, e.g.:

./boost/iterator/detail/facade_iterator_category.hpp:161:5: error: zero as null pointer constant [-Werror,-Wzero-as-null-pointer-constant]
    BOOST_MPL_ASSERT_NOT((is_iterator_category<Traversal>));
    ^
./boost/mpl/assert.hpp:324:58: note: expanded from macro 'BOOST_MPL_ASSERT_NOT'
              boost::mpl::assert_not_arg( (void (*) pred)0, 1 ) \

Newer compilers may warn when using `0`, e.g.:
```
./boost/iterator/detail/facade_iterator_category.hpp:161:5: error: zero as null pointer constant [-Werror,-Wzero-as-null-pointer-constant]
    BOOST_MPL_ASSERT_NOT((is_iterator_category<Traversal>));
    ^
./boost/mpl/assert.hpp:324:58: note: expanded from macro 'BOOST_MPL_ASSERT_NOT'
              boost::mpl::assert_not_arg( (void (*) pred)0, 1 ) \
```
Flamefire added a commit to Flamefire/iterator that referenced this pull request May 6, 2023
The MPL version is slower to compile and `BOOST_STATIC_ASSERT` is
already used in some places. So unify that.

This also fixes `Wzero-as-null-pointer-constant` warnings, see boostorg/mpl#75
@Flamefire
Copy link
Contributor Author

Appveyor build failure seems to be a transient github error

Lastique pushed a commit to boostorg/iterator that referenced this pull request May 7, 2023
The MPL version is slower to compile and `BOOST_STATIC_ASSERT` is
already used in some places. So unify that.

This also fixes `Wzero-as-null-pointer-constant` warnings, see boostorg/mpl#75
@mclow mclow merged commit b440c45 into boostorg:develop May 11, 2023
@Flamefire Flamefire deleted the nullptr branch May 11, 2023 06:57
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