Hi,

I just landed on inbound the patches in bug 1267550, which renamed
MOZ_WARN_UNUSED_RESULT as MOZ_MUST_USE.

A shorter name was in order because it's an attribute that is already
used widely, and should be used even more, because it catches real
problems. In fact, any function that is fallible and returns a
non-pointer value (usually a bool or nsresult) is a candidate for a
MOZ_MUST_USE annotation.

(Unfortunately MOZ_MUST_USE is no help with functions that return
pointers and use nullptr to indicate failure, because even if you
forget to null-check such a pointer you will still use it and the
compiler won't complain.)

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

Reply via email to