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 reserved identifier collisions with newlib #281

Merged
merged 1 commit into from
Aug 15, 2023

Conversation

ehntoo
Copy link
Contributor

@ehntoo ehntoo commented Aug 12, 2023

Newlib defines a macro _U in ctype.h (https://github.com/bminor/newlib/blob/048031501043e61ca31713b92ce2190213c7fb21/newlib/libc/include/ctype.h#L60-L67), resulting in a collision with the existing template names for __compressed_pair. Use _T1 and _T2 instead of _T and _U to avoid this collision. _T1 and _T2 are already used elsewhere, for example in type_list.hpp (

template <class _T0, class _T1, class _T2, class _T3, class... _Ts>
), so their use here should hopefully not introduce any new collisions with other environments.

Fixes #187.

Readme example compiler explorer demonstrating the original issue:
https://godbolt.org/z/s6qzafWP4

And a successful build made with this patch:
https://godbolt.org/z/zbMf4hddj

Newlib defines a macro _U in ctypes.h, resulting in a collision with
the existing template names for __compressed_pair. Use _T1 and _T2
instead of _T and _U to avoid this collision.

Fixes kokkos#187.
Copy link
Contributor

@mhoemmen mhoemmen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the work-around! : - )

@mhoemmen
Copy link
Contributor

This should fix #187 , from what I understand. Thanks for contributing! : - )

@mhoemmen mhoemmen merged commit f840358 into kokkos:stable Aug 15, 2023
4 checks passed
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.

Build failing on GCC arm due to _N defined as a macro
2 participants