Fix alignment warning when building with -Wcast-align#42
Fix alignment warning when building with -Wcast-align#42polluxsynth wants to merge 1 commit intomborgerding:masterfrom
Conversation
When building with -Wcast-align, we get a warning because the alignment of st->substate is not known by kiss_fftr_alloc() so shift the data around so that we don't need to care about the alignment for st->substate. Signed-off-by: Ricard Wanderlof <ricardw@axis.com>
fb1b9bb to
31018ea
Compare
|
gcc 8.3.0 Note however, that as I mentioned in the commit message, that the warning only occurs when enabling the compiler switch -Wcast-align, which isn't enabled in the Makefile in the library, however, it is enabled in the code that I was using the library in. All the patch does is move the various chunks of data around in the single allocated area so that the substate is at the end of the allocated area, where it's not important what size it is. |
|
Strange. I see no such warning with gcc 8.3.1 (CentOS 8 stream). Not sure about the Makefile you are using to compile it, but |
|
That's interesting. (I honestly hadn't looked at the tools/ and test/ Makefiles, just a quick glance at the top level one). I wonder if it could be CPU dependent? I'm building for ARM (Cortex-A9). |
|
I saw these warnings too fixing some others here but fixing them looks non-trivial. |
When building with -Wcast-align, we get a warning because the
alignment of st->substate is not known by kiss_fftr_alloc() so shift
the data around so that we don't need to care about the alignment for
st->substate.
Signed-off-by: Ricard Wanderlof ricardw@axis.com