[問題] 嵌入式特殊語意
開發平台(Platform): (Ex: Win10, Linux, ...)
CortexM0
編譯器(Ex: GCC, clang, VC++...)+目標環境(跟開發平台不同的話需列出)
gcc-arm-none-eabi-4_8-2014q1-20140314-linux
問題(Question):
目前正在玩nRF51822,核心是CortexM0,沒有OS,
在追蹤它提供的一些util時發現某個有趣的寫法,
搞不懂它為何要拆成兩行來寫,
static __INLINE uint8_t app_sched_queue_empty()
{
uint8_t tmp = m_queue_start_index;
return m_queue_end_index == tmp;
}
如果改寫成return(m_queue_end_index == m_queue_start_index),
實際執行時會發生啥不可預期的結果嗎?
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 60.251.47.144
※ 文章網址: https://www.ptt.cc/bbs/C_and_CPP/M.1492150454.A.259.html
推
04/14 14:14, , 1F
04/14 14:14, 1F
→
04/14 14:16, , 2F
04/14 14:16, 2F
→
04/14 14:16, , 3F
04/14 14:16, 3F
→
04/14 15:56, , 4F
04/14 15:56, 4F
推
04/14 16:27, , 5F
04/14 16:27, 5F
推
04/14 17:00, , 6F
04/14 17:00, 6F
推
04/14 17:24, , 7F
04/14 17:24, 7F
推
04/14 17:40, , 8F
04/14 17:40, 8F
推
04/14 19:15, , 9F
04/14 19:15, 9F
推
04/14 19:16, , 10F
04/14 19:16, 10F
→
04/14 19:17, , 11F
04/14 19:17, 11F
→
04/14 19:18, , 12F
04/14 19:18, 12F
→
04/14 19:18, , 13F
04/14 19:18, 13F
推
04/14 19:46, , 14F
04/14 19:46, 14F
→
04/14 20:45, , 15F
04/14 20:45, 15F
→
04/16 00:19, , 16F
04/16 00:19, 16F