mirror of https://github.com/lumapu/ahoy.git
Browse Source
When built with -Wall the idiom `({ … })` leads to a "value computed is
not used" warning. That notation produces a compound statement that
acts as an expression with the value being the value of the last
statement inside. For the switch statement it is not even clear what
this value would be and it is never used anywhere (hence the warning).
For the CP_ macros it would be one byte out of four right? Makes no
sense either.
You would have to assign that value to something, but then you would use
a real function with a return type, because that is easier to understand
anyways.
So why not use the usual way to create a void function like
preprocessor macro in C/C++ by using a do-while-loop with a false
condition. Warning disappears.
Link: https://gcc.gnu.org/onlinedocs/cpp/Swallowing-the-Semicolon.html
Fixes: 0347a3df44
("* PR #76 updated debug messages: now 5 different levels are available * fixed CRC loop issue")
pull/1191/head
2 changed files with 10 additions and 10 deletions
Loading…
Reference in new issue