<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Feb 8, 2021 at 12:39 PM Gedare Bloom <<a href="mailto:gedare@rtems.org">gedare@rtems.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Feb 8, 2021 at 11:24 AM Joel Sherrill <<a href="mailto:joel@rtems.org" target="_blank">joel@rtems.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hi<div><br></div><div>There are more than a couple of these. in our set of CIDs. I am wondering if these can be addressed with a macro like this:</div><div><br></div><div>#define _IGNORED_RETURN_STATUS(_status, _ok) \</div><div>  do { \</div><div>    _Assert((_status) == (_ok)); \</div></div></blockquote><div><br></div><div>Can you also pass the comparison? I guess it would usually be ==, but it could be != sometimes? I think that is the main challenge here.</div></div></div></blockquote><div><br></div><div>How about 2 macro names? One for positive and one for negative</div><div><br></div><div>_IGNORE_RETURN_STATUS_EQ</div><div>_IGNORE_RETURN_STATUS_NEQ</div><div><br></div><div>Or even _Assert_Return_status_eq and _neq. I'd like these to be candidates for our internal assert.h</div><div><br></div><div>It will end up being three arguments otherwise. It would be nice to keep it reliably to one line.</div><div> <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_quote"><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>   (void) (_status);</div><div>  } while (0);</div><div><br></div><div>Or _Assert_Ignored_return?</div><div><br></div><div>The ones I have looked at, the return value should always be successful but there isn't any reason we can't be defensive about them.</div><div><br></div><div>Thoughts.</div><div><br></div><div>--joel</div></div>
_______________________________________________<br>
devel mailing list<br>
<a href="mailto:devel@rtems.org" target="_blank">devel@rtems.org</a><br>
<a href="http://lists.rtems.org/mailman/listinfo/devel" rel="noreferrer" target="_blank">http://lists.rtems.org/mailman/listinfo/devel</a></blockquote></div></div>
</blockquote></div></div>