-
Notifications
You must be signed in to change notification settings - Fork 170
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
lib: fix compile error #312
Conversation
Please detail the issue you are facing. Your commit partially reverts 9855f84. |
I have conducted further investigation. Therefore, we need to rework the fix introduce by commit 9855f84. First, could you close #314 and address it here ? Then it seems that we can use Could you replace And verify that it works in you case? |
@wyr-7 It will be nice to address it for this release as it fix a bug. |
@arnopo We will update this PR today evening (Your Time). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
one comment + Please, could you also update lib/error.h (see 9855f84#diff-aa1a7db6b5986ae989644bcaefc8a3076f07aa97be4d7176ec93f788b9c21ea2L17)
lib/atomic.h
Outdated
#elif defined(HAVE_STDATOMIC_H) && !defined(__CC_ARM) && !defined(__arm__) && \ | ||
!defined(__STDC_NO_ATOMICS__) | ||
#elif defined(HAVE_STDATOMIC_H) && !defined(__STDC_NO_ATOMICS__) && \ | ||
(!defined(__ARMCC_VERSION) || defined(__GNUC__)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do you need to add the || defined(GNUC) ?
I would expect that you only replace!defined(__CC_ARM) && !defined(__arm__)
by !defined(__ARMCC_VERSION)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@arnopo It was considered that other compilers did not meet this condition, but now it seems that it is not necessary, I have removed it.
could you also address this remaing issue? |
lib/errno.h: defined(__ARMCC_VERSION) for use GCC compile lib/autmoic:fix compiler error: nuttx/include/metal/compiler/gcc/atomic.h:19:13: error: conflicting type qualifiers for 'atomic_flag' 19 | typedef int atomic_flag; | ^~~~~~~~~~~ In file included from nuttx/include/nuttx/net/netdev_lowerhalf.h:38, from virtio/virtio-net.c:33: prebuilts/gcc/linux/arm/lib/gcc/arm-none-eabi/13.2.1/include/ stdatomic.h:233:3: note: previous declaration of 'atomic_flag' with type 'atomic_flag' 233 | } atomic_flag; | ^~~~~~~~~~~ nuttx/include/metal/compiler/gcc/atomic.h:20:14: error: conflicting type qualifiers for 'atomic_char' 20 | typedef char atomic_char; ^~~~~~~~~~~ Signed-off-by: Yongrong Wang <[email protected]>
@arnopo Ok, I have update lib/compiler.h too. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will need to test it with armcc before merging it but look got o go for this release
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me.
Ok, thanks. |
Tested with success on Keil with arm compiler 6.21 |
lib/errno.h: defined(__ARMCC_VERSION) for use GCC compile
lib/autmoic:fix compiler error:
nuttx/include/metal/compiler/gcc/atomic.h:19:13: error: conflicting type qualifiers for 'atomic_flag'
19 | typedef int atomic_flag;
| ^~~~~~~~~~~
In file included from nuttx/include/nuttx/net/netdev_lowerhalf.h:38,
from virtio/virtio-net.c:33:
prebuilts/gcc/linux/arm/lib/gcc/arm-none-eabi/13.2.1/include/
stdatomic.h:233:3: note: previous declaration of 'atomic_flag' with
type 'atomic_flag'
233 | } atomic_flag;
| ^~~~~~~~~~~
nuttx/include/metal/compiler/gcc/atomic.h:20:14: error: conflicting
type qualifiers for 'atomic_char'
20 | typedef char atomic_char;
^~~~~~~~~~~