On 1/19/2017 3:13 PM, Nicholas Nethercote wrote:
On Fri, Jan 20, 2017 at 10:01 AM, <gsquel...@mozilla.com> wrote:
> And the next step would be to make must-use the default, and have
> MOZ_CAN_IGNORE for the rest. ;-)
>
I actually tried this with all XPIDL methods. After adding several hundred
"Unused <<" annotations for calls that legitimately didn't need to check
the return value -- and I was only a fraction of the way through the
codebase -- I decided that a big bang approach wasn't going to work. So I
then implemented [must_use] as an incremental alternative.
To encourage all new XPIDL methods to use must_use, could you add
MOZ_MUST_USE to the C++ macro definition of NS_IMETHOD and rename all
the existing uses of NS_IMETHOD to something like
NS_IMETHOD_RESULT_OPTIONAL or NS_IMETHOD_RESULT_UNUSED? Developers
adding new methods will reach the familiar (and shorter) NS_IMETHOD
macro and get must_use for free.
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform