BUILD: fix missing include for std::ptrdiff_t for C++23 language mode#27361
Merged
charris merged 1 commit intonumpy:mainfrom Sep 9, 2024
eugo-inc:fix-ptrdiff_t-missing-include-in-cxx-23
Merged
BUILD: fix missing include for std::ptrdiff_t for C++23 language mode#27361charris merged 1 commit intonumpy:mainfrom eugo-inc:fix-ptrdiff_t-missing-include-in-cxx-23
charris merged 1 commit intonumpy:mainfrom
eugo-inc:fix-ptrdiff_t-missing-include-in-cxx-23
Conversation
Member
|
Thanks @gorloffslava . |
Contributor
Author
|
@charris thanks for merging! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This tiny PR fixes a failure happening when building numpy in C++23 language mode.
This issue is caused by the ongoing cleanup of C++ standard library from transitive includes, if they aren't explicitely allowed by the standard.
In particular, in string_fastsearch.h we rely on
std::ptrdiff_tbut don't explicitely include its header,cstddef, as prescribed bt the standard.Before C++23, this worked fine as some other headers we included transitvely included
cstddef.Without this fix, both on Clang/LLVM and GCC upstreams the following error is observed:
../numpy/_core/src/umath/string_fastsearch.h:132:5: error: no type named 'ptrdiff_t' in namespace 'std'; did you mean simply 'ptrdiff_t'?Please, find the attached logs with full details.
log.txt