<div dir="ltr">If it was actually the last value, that wouldn't be an issue. But it's actually set to 1L << 16 which is not any of the real values. I expect they're using this as a trick to force the type of the enum to be a 32-bit int, since before C++11, there was no way to specify the type of the enum directly.<div><br></div><div>If that's so, they could switch to using "enum _Ios_Fmtflags : uint32_t" now.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Oct 16, 2015 at 9:00 AM, Yury Gribov 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 class="HOEnZb"><div class="h5">On 10/11/2015 09:59 PM, Joerg Sonnenberger via cfe-dev wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On Sun, Oct 11, 2015 at 07:58:32PM +0200, Kim Gräsman wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi Joerg,<br>
<br>
On Sat, Oct 10, 2015 at 1:33 PM, Joerg Sonnenberger via cfe-dev<br>
<<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a>> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On Sat, Oct 10, 2015 at 10:21:17AM +0200, Kim Gräsman via cfe-dev wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Alternatively, if we could get a patch into Poco, is there something<br>
like MSVC's #pragma(warning:disable) for Clang, so they could<br>
selectively silence the warning around this function?<br>
</blockquote>
<br>
add GCC diagnostic push<br>
#pragma GCC diagnostic ignored "-Wswitch"<br>
... your function here...<br>
#pragma GCC diagnostic pop<br>
<br>
I think it also works with clang as pragma group.<br>
</blockquote>
<br>
Thanks, that's what I was looking for in the way of disabling. To<br>
confirm, #pragma clang diagnostic also works.<br>
<br>
I think we've agreed to rewrite the function in Poco using if/else<br>
instead of switch, because it was hard to find a switch phrasing that<br>
worked with all -W combinations (-Weverything overrode the #pragma<br>
diagnostic and threw diagnostics for code that worked with -Wall).<br>
<br>
That said, it might be worth trying to make Clang aware of libstdc++'s<br>
enum convention, but I haven't thought of a way to do so yet.<br>
</blockquote>
<br>
I don't think there is anything Clang can or should do here, but please<br>
fill an upstream report against GCC if they still do it in the most<br>
recent version.<br>
</blockquote>
<br></div></div>
Using the last enum value (often suffixed with "_end" or "_last") to track total number of values is a common coding practice so I'm not sure they are going to fix this.<br>
<br>
-Y<div class="HOEnZb"><div class="h5"><br>
<br>
_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a><br>
</div></div></blockquote></div><br></div>