Boost logo

Boost :

Subject: Re: [boost] Current Guidance on Compiler Warnings?
From: Stephan T. Lavavej (stl_at_[hidden])
Date: 2018-11-29 23:24:25


Since this is very likely to be by design forever, I think you can skip filing a bug.

STL

From: degski <degski_at_[hidden]>
Sent: Thursday, November 29, 2018 1:26 AM
To: Stephan T. Lavavej <stl_at_[hidden]>
Cc: boost <boost_at_[hidden]>
Subject: Re: [boost] Current Guidance on Compiler Warnings?

On Tue, 27 Nov 2018 at 22:26, Stephan T. Lavavej <stl_at_[hidden]<mailto:stl_at_[hidden]>> wrote:
[degski]
> Interestingly [or maybe not so interestingly] MSVC (15.8/7) is the only compiler
> available there [on godbolt] that does NOT produce more optimal code for the
> 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.html55dcb523%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636790803755931797&sdata=XGFh3Was%2FA0sEzMysPq%2FUMTpnjy6RoQ%2BIePzPNDrVX4%3D&reserved=0> .

 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 with MSVC.

Please confirm that you still want me to file a bug, iff yes, I'll do so.

degski
--
“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