On Tue, Aug 23, 2016 at 11:40 PM, Benjamin Smedberg
<benja...@smedbergs.us> wrote:
> cast-to-void is commonly suggested as an alternative to an explicit unused
> marking, and it is something that I wanted to use originally.
> Unfortunately, we have not been able to make that work: this is primarily
> because compilers often remove the cast-to-void as part of the parsing
> phase, so it's not visible in the parse tree for static checkers.

Also, while casting to void is enough to satisfy clang when calling a
MOZ_MUST_USE function, it doesn't satisfy GCC. Using mozilla::Unused,
as Michael mentioned elsewhere in the thread, is enough to satisfy
both compilers.

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

Reply via email to