mirror of https://github.com/thesofproject/sof.git
Use typeof() to make ASSUME_ALIGNED() type safe
Use gcc typeof() to cast the output of ASSUME_ALIGNED() back into the type of its argument. This lets the compiler report type mismatches. Signed-off-by: Marc Herbert <marc.herbert@intel.com>
This commit is contained in:
parent
bd54434a2f
commit
2cbca2f20e
|
@ -179,7 +179,7 @@
|
||||||
* alignment. This compiler builtin may not be available on all compilers so
|
* alignment. This compiler builtin may not be available on all compilers so
|
||||||
* this macro can be defined as NULL if needed.
|
* this macro can be defined as NULL if needed.
|
||||||
*/
|
*/
|
||||||
#define ASSUME_ALIGNED(x, a) __builtin_assume_aligned(x, a)
|
#define ASSUME_ALIGNED(x, a) ((typeof(x))__builtin_assume_aligned((x), a))
|
||||||
#endif /* __XCC__ */
|
#endif /* __XCC__ */
|
||||||
|
|
||||||
#endif /* __ASSEMBLER__ */
|
#endif /* __ASSEMBLER__ */
|
||||||
|
|
Loading…
Reference in New Issue