view tests/mini/union2.d @ 849:ba390e5e9150

Remove unportable env-sanitizing code. If it is really needed, it needs to be rethought. Closes #131.
author Christian Kamm <kamm incasoftware de>
date Sun, 14 Dec 2008 16:30:06 +0100
parents 44f08170f4ef
children
line wrap: on
line source

module union2;

union U
{
    float f;
    long l;
}

U u;

void main()
{
    assert(u.f !<>= 0);
    {
        uint* p = 1 + cast(uint*)&u;
        {assert(*p == 0);}
    }
}