[webkit-reviews] review denied: [Bug 28391] Incorrect casts in JavaScriptCore with gcc-3.4 : [Attachment 34969] proposed patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Aug 21 10:57:00 PDT 2009

Eric Seidel <eric at webkit.org> has denied Kelemen Balázs
<Kelemen.Balazs.3 at stud.u-szeged.hu>'s request for review:
Bug 28391: Incorrect casts in JavaScriptCore with gcc-3.4

Attachment 34969: proposed patch

------- Additional Comments from Eric Seidel <eric at webkit.org>
No your fault, but I went to look up WTF::bitwise_cast, only to find that the
comment next to bitwise_cast is basically useless:

     * C++'s idea of a reinterpret_cast lacks sufficient cojones.
    template<typename TO, typename FROM>
    TO bitwise_cast(FROM from)
	COMPILE_ASSERT(sizeof(TO) == sizeof(FROM),
	union {
	    FROM from;
	    TO to;
	} u;
	u.from = from;
	return u.to;

And I would expect that bitwise_cast violates the c++ standard, since I've been
told that only the last union member you write to is valid to read from, any
other member is undefined.  (I've also been told the GCC does define this
behavior and that our use of unions here will work for GCC.   I'm anything bug
a C++ standards expert though.)

I agree with oliver,  GCC 3.x is not supported for WebKit.  I don't think we
should take one-off patches for it, since it's undoubtably going to break

More information about the webkit-reviews mailing list