microsoft / microsoft/react-native-windows
JsiAbiApi uses deprecated std::aligned_storage
Open
Nobody has claimed this yet.
Area: Build Infrastructure
Engineering Improvement Candidate
enhancement
Workstream: Developer Experience
- Dominant language
- C++
- Stars
- 17.3k
- Forks
- 1.2k
- Avg merge
- 1d 13h
- Merged PRs (30d)
- 33
Description
trying to build this in an app targeting c++23, breaks the build.
1>F:\react-native-xaml\examplenuget\windows\packages\Microsoft.ReactNative.Cxx.0.65.7\tools\Microsoft.ReactNative.Cxx\JSI\JsiAbiApi.h(257,28): error C4996: 'std::aligned_storage_t': warning STL4034: std::aligned_storage and std::aligned_storage_t are deprecated in C++23. Prefer alignas(T) std::byte t_buff[sizeof(T)]. You can define _SILENCE_CXX23_ALIGNED_STORAGE_DEPRECATION_WARNING or _SILENCE_ALL_CXX23_DEPRECATION_WARNINGS to acknowledge that you have received this warning. (compiling source file XamlObject.cpp)
1>F:\react-native-xaml\examplenuget\windows\packages\Microsoft.ReactNative.Cxx.0.65.7\tools\Microsoft.ReactNative.Cxx\JSI\JsiAbiApi.h(281,28): error C4996: 'std::aligned_storage_t': warning STL4034: std::aligned_storage and std::aligned_storage_t are deprecated in C++23. Prefer alignas(T) std::byte t_buff[sizeof(T)]. You can define _SILENCE_CXX23_ALIGNED_STORAGE_DEPRECATION_WARNING or _SILENCE_ALL_CXX23_DEPRECATION_WARNINGS to acknowledge that you have received this warning. (compiling source file XamlObject.cpp)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with JSI/JsiAbiApi.h at the referenced lines 258 and 281, then reproduce the C++23 build using the reported XamlObject.cpp compilation. Done means the header no longer triggers the reported std::aligned_storage deprecation errors while preserving the existing build behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- desktop
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 35/100