WebAssembly / WebAssembly/binaryen

Iterator related warnings in visual studio build

Open
#3,661 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
WebAssembly
Stars
8.6k
Forks
885
Avg merge
1d 19h
Merged PRs (30d)
69

Description

2>C:\src\binaryen\src\wasm-type.h(221,26): warning C4996: 'std::iterator<std::random_access_iterator_tag,wasm::Type,long,wasm::Type *,const wasm::Type &>': warning STL4015: The std::iterator class template (used as a base class to provide typedefs) is deprecated in C++17. (The <iterator> header is NOT deprecated.) The C++ Standard has never required user-defined iterators to derive from std::iterator. To fix this warning, stop deriving from std::iterator and start providing publicly accessible typedefs named iterator_category, value_type, difference_type, pointer, and reference. Note that value_type is required to be non-const, even for constant iterators. You can define _SILENCE_CXX17_ITERATOR_BASE_CLASS_DEPRECATION_WARNING or _SILENCE_ALL_CXX17_DEPRECATION_WARNINGS to acknowledge that you have received this warning. (compiling source file C:\src\binaryen\src\asmjs\asm_v_wasm.cpp)
2>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\include\xutility(6006,54): message : see declaration of 'std::iterator' (compiling source file C:\src\binaryen\src\asmjs\asm_v_wasm.cpp)
2>C:\src\binaryen\src\wasm-type.h(251,26): warning C4996: 'std::iterator<std::random_access_iterator_tag,wasm::Type,long,wasm::Type *,const wasm::Type &>::difference_type': warning STL4015: The std::iterator class template (used as a base class to provide typedefs) is deprecated in C++17. (The <iterator> header is NOT deprecated.) The C++ Standard has never required user-defined iterators to derive from std::iterator. To fix this warning, stop deriving from std::iterator and start providing publicly accessible typedefs named iterator_category, value_type, difference_type, pointer, and reference. Note that value_type is required to be non-const, even for constant iterators. You can define _SILENCE_CXX17_ITERATOR_BASE_CLASS_DEPRECATION_WARNING or _SILENCE_ALL_CXX17_DEPRECATION_WARNINGS to acknowledge that you have received this warning. (compiling source file C:\src\binaryen\src\asmjs\asm_v_wasm.cpp)
2>C:\src\binaryen\src\wasm-type.h(255,24): warning C4996: 'std::iterator<std::random_access_iterator_tag,wasm::Type,long,wasm::Type *,const wasm::Type &>::difference_type': warning STL4015: The std::iterator class template (used as a base class to provide typedefs) is deprecated in C++17. (The <iterator> header is NOT deprecated.) The C++ Standard has never required user-defined iterators to derive from std::iterator. To fix this warning, stop deriving from std::iterator and start providing publicly accessible typedefs named iterator_category, value_type, difference_type, pointer, and reference. Note that value_type is required to be non-const, even for constant iterators. You can define _SILENCE_CXX17_ITERATOR_BASE_CLASS_DEPRECATION_WARNING or _SILENCE_ALL_CXX17_DEPRECATION_WARNINGS to acknowledge that you have received this warning. (compiling source file C:\src\binaryen\src\asmjs\asm_v_wasm.cpp)
2>C:\src\binaryen\src\wasm-type.h(258,26): warning C4996: 'std::iterator<std::random_access_iterator_tag,wasm::Type,long,wasm::Type *,const wasm::Type &>::difference_type': warning STL4015: The std::iterator class template (used as a base class to provide typedefs) is deprecated in C++17. (The <iterator> header is NOT deprecated.) The C++ Standard has never required user-defined iterators to derive from std::iterator. To fix this warning, stop deriving from std::iterator and start providing publicly accessible typedefs named iterator_category, value_type, difference_type, pointer, and reference. Note that value_type is required to be non-const, even for constant iterators. You can define _SILENCE_CXX17_ITERATOR_BASE_CLASS_DEPRECATION_WARNING or _SILENCE_ALL_CXX17_DEPRECATION_WARNINGS to acknowledge that you have received this warning. (compiling source file C:\src\binaryen\src\asmjs\asm_v_wasm.cpp)
2>C:\src\binaryen\src\wasm-type.h(262,24): warning C4996: 'std::iterator<std::random_access_iterator_tag,wasm::Type,long,wasm::Type *,const wasm::Type &>::difference_type': warning STL4015: The std::iterator class template (used as a base class to provide typedefs) is deprecated in C++17. (The <iterator> header is NOT deprecated.) The C++ Standard has never required user-defined iterators to derive from std::iterator. To fix this warning, stop deriving from std::iterator and start providing publicly accessible typedefs named iterator_category, value_type, difference_type, pointer, and reference. Note that value_type is required to be non-const, even for constant iterators. You can define _SILENCE_CXX17_ITERATOR_BASE_CLASS_DEPRECATION_WARNING or _SILENCE_ALL_CXX17_DEPRECATION_WARNINGS to acknowledge that you have received this warning. (compiling source file C:\src\binaryen\src\asmjs\asm_v_wasm.cpp)
2>C:\src\binaryen\src\wasm-type.h(265,5): warning C4996: 'std::iterator<std::random_access_iterator_tag,wasm::Type,long,wasm::Type *,const wasm::Type &>::difference_type': warning STL4015: The std::iterator class template (used as a base class to provide typedefs) is deprecated in C++17. (The <iterator> header is NOT deprecated.) The C++ Standard has never required user-defined iterators to derive from std::iterator. To fix this warning, stop deriving from std::iterator and start providing publicly accessible typedefs named iterator_category, value_type, difference_type, pointer, and reference. Note that value_type is required to be non-const, even for constant iterators. You can define _SILENCE_CXX17_ITERATOR_BASE_CLASS_DEPRECATION_WARNING or _SILENCE_ALL_CXX17_DEPRECATION_WARNINGS to acknowledge that you have received this warning. (compiling source file C:\src\binaryen\src\asmjs\asm_v_wasm.cpp)
2>C:\src\binaryen\src\wasm-type.h(269,5): warning C4996: 'std::iterator<std::random_access_iterator_tag,wasm::Type,long,wasm::Type *,const wasm::Type &>::value_type': warning STL4015: The std::iterator class template (used as a base class to provide typedefs) is deprecated in C++17. (The <iterator> header is NOT deprecated.) The C++ Standard has never required user-defined iterators to derive from std::iterator. To fix this warning, stop deriving from std::iterator and start providing publicly accessible typedefs named iterator_category, value_type, difference_type, pointer, and reference. Note that value_type is required to be non-const, even for constant iterators. You can define _SILENCE_CXX17_ITERATOR_BASE_CLASS_DEPRECATION_WARNING or _SILENCE_ALL_CXX17_DEPRECATION_WARNINGS to acknowledge that you have received this warning. (compiling source file C:\src\binaryen\src\asmjs\asm_v_wasm.cpp)

And many more. Last modified here https://github.com/WebAssembly/binaryen/commit/9752196fd1357fbc129d1e4f53e8eb22cd6219f9 but it doesn't seem like the problem was introduced there.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with src/wasm-type.h at the iterator definitions named in the Visual Studio warnings, then reproduce the build to identify the remaining iterator-related warnings. Review the affected iterator declarations and verify that the Visual Studio build no longer reports these C++17 deprecation warnings.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, wasm
Domain
compilers
Issue type
Bug
Difficulty
2/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.