Repository navigation
Drop usage of non-Standard stdext - #1339
Conversation
|
According to the crypto++ site, the current version 8.9.0 could be built with Visual Studio 2003 - 2022. zdeflate.cpp This code compiles quietly in the current VS 2022 17.14.19. |
|
Sure, an upper limit to the MSVC version would be entirely reasonable. |
Remove Microsoft-specific stdext::checked_array_iterator, stdext::unchecked_array_iterator, and stdext::unchecked_mismatch. These were workarounds for old MSVC warnings that were removed in VS 2017 15.8 (August 2018). The stdext iterators are deprecated since VS 2022 17.8 and will be completely removed in VS 2026 18.x. Based on weidai11/cryptopp#1339 Co-Authored-By: Stephan T. Lavavej <stl@microsoft.com>
Drop usage of non-Standard stdext based on weidai11/cryptopp#1339
|
Thanks for the PR, Stephan. Since you agree with irwir's proposal to add an upper limit to the MSVC version, could you please go ahead and update this pull request with those changes? |
|
Pushed. I've retained my unconditional use of |
MSVC 19.51 (VS 2026 18.x) completely removed stdext::make_checked_array_iterator and stdext::make_unchecked_array_iterator, which were previously only deprecated. The cryptopp CRYPTOPP_8_9_0 release tag still uses these removed functions. Enable CRYPTOPP_USE_MASTER_BRANCH to fetch cryptopp from master, which includes the upstream fix (weidai11/cryptopp#1339) that replaces all stdext usage with standard C++ equivalents. Remove the now-unnecessary _SILENCE_STDEXT_ARR_ITERS_DEPRECATION_WARNING workaround.
…opp#1250>. git-svn-id: https://source.openmpt.org/svn/openmpt/trunk/OpenMPT@25561 56274372-70c3-4bfc-bfc3-4c3a0b034d27
[Fix] Crypto++: Apply <weidai11/cryptopp#1339> to fix <weidai11/cryptopp#1250>. ........ git-svn-id: https://source.openmpt.org/svn/openmpt/branches/OpenMPT-1.32@25562 56274372-70c3-4bfc-bfc3-4c3a0b034d27
causes build failures: see weidai11/cryptopp#1339 my workflow honestly lives in 2022 anyway but i wanted to give windows-latest a try.
Fixes #1250.
I'm the primary maintainer of MSVC's C++ Standard Library. We build popular open-source projects, including cryptopp, with development builds of our toolset in order to find and fix regressions in the compiler and libraries before they can ship and cause trouble for you. This also allows us to provide advance notice of breaking changes, which is the case here.
Long ago, we used to emit incredibly obnoxious warnings about using raw pointers as output iterators, which could be avoided by using our non-Standard
stdext::checked_array_iteratororstdext::unchecked_array_iterator. Those warnings were removed in VS 2017 15.8, released in August 2018.Later, we deprecated these
stdextiterators for C++17 and later in VS 2022 17.8 in November 2023, as reported by #1250. We then strengthened the deprecation to be unconditional (i.e. also C++14 mode) in VS 2022 17.11 in August 2024.They're still present (and deprecated) in the MSVC Build Tools 14.50 which will be shipping in VS 2026 18.0. However, I've completely removed them in the MSVC Build Tools 14.51 (with microsoft/STL#5817), which will ship in a future update to VS 2026 18.x.
Now that the
stdextiterators are no longer needed to avoid obnoxious warnings, their usage can simply be removed, calling Standard algorithms with raw pointers directly.I also took this opportunity to remove a strange-looking call to
stdext::unchecked_mismatchthat appeared to be used for only certain old versions of MSVC, although I don't understand what was happening there (I've worked on the STL since 2007 and I've never seen such an algorithm in thestdextnamespace). In any event, calling Standardmismatchis the right thing to do.