This sounds like something I should be able to Google, but I can't find a good reference. What exactly does __attribute__((force))
do? As in:
return (__attribute__((force)) uint32_t) *p
(this is for an ARM system, cross compiled with clang, but I can't find any reference anywhere on this attribute even in clang/arm specific pages..).
__attribute__((force))
is used to suppress warnings in sparse, the c semantics checker of the linux kernel.
The wikipedia article of sparse lists the following attributes as defined by sparse:
If you need more information about these, you can take a look at the man page of sparse
In the linux kernel some these attributes are redefined in linux/include/linux/compiler_types.h. For example __force
expands to __attribute__((force))
or __bitwise
to __attribute__((bitwise))
.
However the linux documentation about sparse tells us, that gcc ignores these attributes:
And with gcc, all the “__bitwise”/”__force stuff” goes away, and it all ends up looking just like integers to gcc.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With