/usr1/openeuler/build/arm64_standard_llvm/tmp/work/aarch64-openeuler-linux/openamp/2022.04.0-r0/openamp-2022.04.0/lib/proxy/rpmsg_retarget.c:49:4: error: member reference base type 'atomic_int' (aka '_Atomic(int)') is not a structure or union
The error is reported every time the atomic_flag function is called.
The reason is that the usage of atomic_flag-related functions in some codes does not comply with the language standard(The parameter &rpc->nacked is a atomic_int while the function requires a atomic_flag). The Clang function library has stricter input type restrictions (clang gets the _Value subitem of the input atomic_flag parameter, gcc does not) , then preceding error occurs.
clang version of atomic_flag
gcc version
Therefore, the input parameter type should be changed from atomic_int to atomic_flag, and the corresponding initialization function atomic_init() should be changed to atomic_flag_test_and_set().
Error when compile with clang on AArch64
The error is reported every time the atomic_flag function is called.
https://github.com/OpenAMP/open-amp/blob/7513776e35225ce604773b6d42316a93ef544c60/lib/proxy/rpmsg_retarget.c#L49
The reason is that the usage of atomic_flag-related functions in some codes does not comply with the language standard(The parameter
&rpc->nacked
is aatomic_int
while the function requires aatomic_flag
). The Clang function library has stricter input type restrictions (clang gets the_Value
subitem of the inputatomic_flag
parameter, gcc does not) , then preceding error occurs.clang version of
atomic_flag
gcc version
Therefore, the input parameter type should be changed from
atomic_int
toatomic_flag
, and the corresponding initialization functionatomic_init()
should be changed toatomic_flag_test_and_set()
.Related description in the C11 standard: https://en.cppreference.com/w/cpp/atomic/atomic_flag_clear https://en.cppreference.com/w/cpp/atomic/atomic_flag_test_and_set