fft.h: include <cstring> for std::memcpy#2
Open
FakeSohi wants to merge 1 commit intoSignalsmith-Audio:mainfrom
Open
fft.h: include <cstring> for std::memcpy#2FakeSohi wants to merge 1 commit intoSignalsmith-Audio:mainfrom
FakeSohi wants to merge 1 commit intoSignalsmith-Audio:mainfrom
Conversation
std::memcpy is used in RealFFT<>::fft and ::ifft but <cstring> is not included directly. Older libstdc++ versions pulled it in transitively via other headers, but GCC 13+ (e.g. MSYS2 UCRT64) does not, producing: error: 'memcpy' is not a member of 'std'; did you mean 'wmemcpy'? Adding the explicit include fixes the build on stricter toolchains without affecting platforms that previously compiled by accident.
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.
Summary
fft.husesstd::memcpyinsideRealFFT<>::fftandRealFFT<>::ifft(lines 1074 and 1284) without including<cstring>. On older libstdc++ this header was pulled in transitively through other standard headers, so the build succeeded by accident. Newer toolchains (GCC 13+, which ships with MSYS2 UCRT64) have reduced the transitive-include graph, and the build now fails with:This one-line change adds an explicit
#include <cstring>so the header is self-contained and compiles on any conformant toolchain, without affecting platforms that previously compiled by accident.Reproduced while building
signalsmith-stretch's C shim against MSYS2 UCRT64 (GCC 15.x):Test plan
signalsmith-stretchcommand above under MSYS2 UCRT64 — compiles cleanly with the patch applied#includeso no behavior change is expected