Hi Stefan

I understand quite well what aliasing means and I still think that this is a 
compiler bug.

Strict-aliasing means the compiler can assume two variables of different types 
do not point to the same memory -- except when they're in a union. That's the 
whole point of a union, after all:

    union {
        Type1 t1;
        Type2 t2;
    } u;
    u.t1 = something;
    u.t2 = somethingelse;
    use(u.t1); // here the compiler knows for a fact that u.t1 changed

In the case of QMutex, both mtx and val are in a union. So the compiler knows 
that modifying one results in modifications to the other.

There is no pointer dereferencing involved, no casting of any kind. The object 
of type QMutex is never accessed using any other type -- in fact, its access is 
completely irrelevant. The two types in question are QMutex* and quintptr -- 
both of which are in the union.
-- 
This message posted from opensolaris.org

Reply via email to