<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Mon, Oct 12, 2015 at 3:04 PM, Nico Weber via cfe-dev <span dir="ltr"><<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><span class="">On Mon, Oct 12, 2015 at 3:02 PM, David Majnemer <span dir="ltr"><<a href="mailto:david.majnemer@gmail.com" target="_blank">david.majnemer@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><span>On Mon, Oct 12, 2015 at 2:18 PM, Reid Kleckner via cfe-dev <span dir="ltr"><<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr">I'd really rather not do 2. Fighting with MSVC CRT headers over va_start has been pretty awkward. Users have reported issues with our header override fails. I'd rather not start fighting with winnt.h.<div><br></div><div>I'm OK with 3, but I'm desensitized to having to do this kind of pattern matching for __uuidof, etc. Maybe we should wait for another +1. :)</div></div></blockquote><div><br></div></span><div>A +1 from me for option #3 as well.  I'd feel more comfortable doing #2 if it was for correctness (along the lines of our  va_start/va_arg hack).</div><div><br></div><div>On what basis does MSVC decide that UNREFERENCED_PARAMETER should silence an unused parameter?  IIRC, it expands to wrapping it's argument in parenthesis.  Could we teach clang to do the same?  Sounds like it could be a more general fix.</div></div></div></div></blockquote><div><br></div></span><div>That sounds like a really good idea to me – teach sema that "(x);" has the same meaning as "(void)x;".</div></div></div></div></blockquote><div><br></div><div>Hold on a moment.</div><div><br></div><div>`(x);` certainly seems like it should silence an "unreferenced parameter" warning (which is what this macro is for in MSVC), but it seems much less reasonable for it to suppress an "unused value" warning (which is the warning we're getting with Clang). This is not an idiom we should encourage for expressing "I am deliberately discarding this value", so I would prefer limiting this to the case where the parens come from a macro named UNREFERENCED_PARAMETER.</div></div></div></div>