【问题标题】:Passing uint8_t to atomic_clr [closed]将 uint8_t 传递给 atomic_clr [关闭]
【发布时间】:2013-07-29 09:38:41
【问题描述】:

uint8_t 传递给atomic_clr 时出现编译器错误。错误是:"passing argument 1 from incompatible pointer type"

这是为什么呢?

【问题讨论】:

  • 你能给我们看一点你的代码吗?
  • 我不同意这是题外话。解释不足,但这是这里的课程的标准。

标签: c atomic


【解决方案1】:

应该是指向 volatile unsigned 的指针

#include <atomic.h>

void atomic_clr( volatile unsigned * loc,
                 unsigned bits );

【讨论】:

  • 好的,那么它至少应该是 32 位?这是为什么?我想知道这个。
  • 好吧,如果它只有 8 位,没有多少位可以摆弄......考虑接受答案。
猜你喜欢
  • 2019-08-22
  • 1970-01-01
  • 2018-10-07
  • 2015-10-12
  • 2010-09-07
  • 2021-04-13
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多