Skip to content
New issue

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

bug: macro function in DAGMCExportCommand.cpp #88

Open
qingfengxia opened this issue Mar 22, 2021 · 4 comments · May be fixed by #89
Open

bug: macro function in DAGMCExportCommand.cpp #88

qingfengxia opened this issue Mar 22, 2021 · 4 comments · May be fixed by #89

Comments

@qingfengxia
Copy link

#define CHK_MB_ERR_RET_MB(A,B)  if (moab::MB_SUCCESS != (B)) { \
  message << (A) << (B) << std::endl;                                   \
  return rval;                                                         \
  }

Wont return A or B instead of rval, which is not in the parameter list?

Although, it does not report error during compiling.

@makeclean
Copy link
Contributor

This macro is to be used where, A is your message to print on failure, B is the return value from some function, this is compared against success, and maybe it should return B instead of rval?

@makeclean
Copy link
Contributor

its inherited from MOAB

@gonuke
Copy link
Member

gonuke commented Mar 22, 2021

I'll have to double check and see if MOAB has the same issue, but I think it should return B

@gonuke
Copy link
Member

gonuke commented Mar 22, 2021

Also, it doesn't report an error because it is always called immediately after evaluating rval and it is in scope

@gonuke gonuke linked a pull request Mar 23, 2021 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants