We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
This...
#define ROS_ASSERT_CMD(cond, cmd) \ do { \ if (!cond) { /* This line */ \ cmd; \ } \ } while (0)
...should be...
#define ROS_ASSERT_CMD(cond, cmd) \ do { \ if (!(cond)) { /* This line */ \ cmd; \ } \ } while (0)
...like it is in ROS_ASSERT() and ROS_ASSERT_MSG(), so that developers don't have to wrap the cond argument in parentheses themselves.
To reproduce, try to compile a ROS_ASSERT_CMD statement where the !cond would be invalid.
E.g. with the following code...
ROS_ASSERT_CMD(myObject == myObject2, return false);
...the compiler will complain that it can't apply the '!' operator to myObject.
So the developer has to use:
ROS_ASSERT_CMD((myObject == myObject2), return false);
But for the other ASSERT macros he/she can keep the natural form:
ROS_ASSERT(myObject == myObject2); ROS_ASSERT_MSG(myObject == myObject2, "Objects aren't equal!");
The text was updated successfully, but these errors were encountered:
5acc512
dirk-thomas
No branches or pull requests
This...
...should be...
...like it is in ROS_ASSERT() and ROS_ASSERT_MSG(), so that developers don't have to wrap the cond argument in parentheses themselves.
To reproduce, try to compile a ROS_ASSERT_CMD statement where the !cond would be invalid.
E.g. with the following code...
...the compiler will complain that it can't apply the '!' operator to myObject.
So the developer has to use:
But for the other ASSERT macros he/she can keep the natural form:
The text was updated successfully, but these errors were encountered: