Subject: Re: [boost] Current Guidance on Compiler Warnings?
From: degski (degski_at_[hidden])
Date: 2018-11-29 09:25:59
On Tue, 27 Nov 2018 at 22:26, Stephan T. Lavavej <stl_at_[hidden]>
> > Interestingly [or maybe not so interestingly] MSVC (15.8/7) is the only
> > available there [on godbolt] that does NOT produce more optimal code for
> > signed integer case (at any optimization level) (STL are you listening).
> I am listening, but I am not a compiler backend dev. :-)
I'll give the guys in the garden shed a shout [**hollering**].
> I recommend filing a bug about the missed optimization opportunity through
> the C++ tab of Developer Community at
> https://developercommunity.visualstudio.com/spaces/62/index.html .
Well, it's UB, so anything can happen, so, is it a bug? It surely misses
an opportunity [one compiler just returns 1 on the first function and does
absolutely nothing else]. Wrapping signed int's doesn't make much sense
[and mixes hardware with software, but hey, that'll go away with C++20].
I'm sympathetic to the effort [of turning it [the UB] into something that
at some level does make sense]. The problem in my view is that [exactly
what you've said below] people depend on it and therefore start writing
non-portable code, without even knowing it. That I think is bad. Is there a
warning? I bet you clang-cl will make a mess of the code that works so well
Please confirm that you still want me to file a bug, iff yes, I'll do so.
-- *âIf something cannot go on forever, it will stop" - Herbert Stein*
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk