Browse Source
Fix warning that reveals a real bug: In file included from libraries/AP_HAL_Linux/UARTDriver.cpp:25:0: libraries/AP_HAL_Linux/UARTDriver.cpp: In member function 'virtual bool Linux::UARTDriver::tx_pending()': libraries/AP_HAL/utility/RingBuffer.h:21:35: warning: logical not is only applied to the left hand side of comparison [-Wlogical-not-parentheses] #define BUF_EMPTY(buf) buf##_head == buf##_tail ^ libraries/AP_HAL_Linux/UARTDriver.cpp:355:13: note: in expansion of macro 'BUF_EMPTY' return !BUF_EMPTY(_writebuf); The problem is when there's a ! operator: without the parenthesis we would actually be doing return !_write_buf_head == _write_buf_tail which is not what we want.master
1 changed files with 1 additions and 1 deletions
Loading…
Reference in new issue