Hi,

This is a moderately common idiom:

  NS_ENSURE_TRUE(foo, );

It also occurs with NS_ENSURE_FALSE and NS_ENSURE_SUCCESS.  It's used
in functions that return |void|.

Unfortunately, it causes warnings with recent versions of clang, and
they can turn into errors if you have --enable-warnings-as-errors.

This alternative is sometimes is used instead, which (surprisingly
enough) avoids the warning:

  NS_ENSURE_TRUE(foo, /* */);

However, this trick isn't needed, because you can instead do this:

  NS_ENSURE_TRUE_VOID(foo);

All of this applies to NS_ENSURE_FALSE and NS_ENSURE_SUCCESS, too.

I've filed bug 824397 to convert the existing cases.  Please use the
_VOID forms in the future.  Thanks!

Nick
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to