Skip to content
Commit 065e8351 authored by Johan Bengtsson's avatar Johan Bengtsson Committed by GitHub
Browse files

DSP: Remove undefined behavior in post-increment/decrement read (#1443)

According to the C standard q15_t * and const q15_t * are not compatible
types which, among other things, imply that an object of type const
q15_t * can't be modified by writing to a q15_t ** or vice versa.
Programs doing this are undefined.

Because of this rule all programs using the functions read_q15x2_ia,
read_q15x2_da, read_q7x4_ia, or read_q7x4_da for reading data from an
array of constant elements will be undefined. To solve this it is not
enough to change the type of the function since this will give problems
when reading data from an array of non-const elements. To get a defined
solution I needed to switch from functions to macros to allow the
increment to be done in the original type of the pointer.
parent 8dcdb350
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment