[osg-users] Potential bug in ref_ptr::assign

Robert Osfield robert.osfield at gmail.com
Wed Oct 25 12:29:46 PDT 2017


Hi Hartwig,

On 25 October 2017 at 19:54, Hartwig Wiesmann <hartwig.wiesmann at skywind.eu>
wrote:

> please do not understand me wrong: I fully understand what is meant but I
> have my doubts that highly optimising compilers are clever enough.
>

I think you are just over thinking possible issues, we have to trust
compilers to do something sensible with our code and if they fail go use
another compiler.

If a compiler can't safely compile this code then it's a dangerous
compiler, it doesn't matter how aggressive the compiler is it shouldn't
result in bugs. If the compiler can't be trusted then you shouldn't use or,
and if you have to then you have to disable the optimisation.

It's not for the OSG to go second guessing what potential bugs there are in
compilers and then implementing workarounds for it.  Where would start?
Where would you stop?  It would be utterly self defeating as the extra
complexity would result in more bugs and less efficiency.

Compilers are there to help us do our job, we have to understand but also
trust them, and only start over complicating our analysis if we find
problems that have no other explanation other than compiler bug.

Robert.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20171025/6b5d262d/attachment.html>


More information about the osg-users mailing list