Skip to content

Commit

Permalink
atomic.h: fix conflicting type qualifiers compiler error
Browse files Browse the repository at this point in the history
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 <wangyongrong@xiaomi.com>
  • Loading branch information
wyr-7 committed Oct 10, 2024
1 parent a4bce35 commit 6a4146f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/atomic.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ using std::atomic_fetch_and_explicit;
using std::atomic_thread_fence;
using std::atomic_signal_fence;

#elif defined(HAVE_STDATOMIC_H) && !defined(__CC_ARM) && !defined(__arm__) && \
!defined(__STDC_NO_ATOMICS__)
#elif defined(HAVE_STDATOMIC_H) && !defined(__STDC_NO_ATOMICS__) && \
((!defined(__CC_ARM) && !defined(__arm__)) || defined(__GNUC__))

Check warning on line 104 in lib/atomic.h

View workflow job for this annotation

GitHub Actions / compliance review

LEADING_SPACE

lib/atomic.h:104 please, no spaces at the start of a line
# include <stdint.h>
# include <stdatomic.h>
#elif defined(__GNUC__)
Expand Down

0 comments on commit 6a4146f

Please sign in to comment.