Closed PerennialNovice closed 2 years ago
The intention indeed seem to be assigning b
to a
instead of comparing them. Don't think this is a bug.
But what could possibly be the purpose of checking whether an assignment returns true? Wouldn't that always be the case?
Maybe take a look at this may help? https://stackoverflow.com/questions/3122284/in-which-case-ifa-b-is-a-good-idea
Thank you!
Very happy to have learned that my assumption was wrong!
Although I still find it a confusing way to write
a=b
if(b != 0)
Seems like a shortcut that drastically reduces code readability...
But do{...}while(0)
is an equally strange way to do things to me
Hello,
Can this issue be closed?
Thank you.
Yes, if no one else objects...
Okay. You can reopen if there are any further discussions.
Thank you.
Hi,
shouldn't this
#define CHECK_RESULT(a,b) do{if(a=b)
rather be
#define CHECK_RESULT(a,b) do{if(a!=b)
in Seeed_SHT35.h line 64