The casting through union is strictly still undefined but it works in
gcc. Unfortunately, that is not the case for all compilers. Apparently
Sun CC will not generate the intended code. See:

http://blog.qt.digia.com/blog/2011/06/10/type-punning-and-strict-aliasing/

A simpler solution, which doesnt need any changes to the
svalue struct would have been to do the write using memcpy, which would
be optimized into one pointer size store. It is defined behavior
which reflects the aliasing correctly and requires only minimal
modification to the original code.

Arne

On Wed, 25 Jun 2014, Chris Angelico wrote:

On Tue, Jun 24, 2014 at 7:54 PM, Chris Angelico <[email protected]> wrote:
I'm starting up a completely fresh Pike clone to see if somehow I've
accumulated cruft of some sort. If that behaves differently, I'll let
you know.

That didn't solve anything, but the latest commit on 8.0 branch did.
Thanks Grubba! Looking good.

ChrisA

  • Cas... Chris Angelico
    • ... Per Hedbor () @ Pike (-) developers forum
    • ... Chris Angelico
      • ... Chris Angelico
        • ... Arne Goedeke
          • ... Arne Goedeke
            • ... Per Hedbor () @ Pike (-) developers forum
              • ... Marcus Comstedt (ACROSS) (Hail Ilpalazzo!) @ Pike (-) developers forum
            • ... Henrik Grubbstr�m (Lysator) @ Pike (-) developers forum

Reply via email to