[Webkit-unassigned] [Bug 87183] Web Inspector: CodeGeneratorInspector.py: protect typed API from C++ implicit float to int cast

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed May 23 21:46:29 PDT 2012


https://bugs.webkit.org/show_bug.cgi?id=87183





--- Comment #8 from Peter Rybin <prybin at chromium.org>  2012-05-23 21:45:33 PST ---
(In reply to comment #7)
> (In reply to comment #6)
> > Yurys,
> > we have a general question here. Current approach filters out only floats and doubles.
> > Andrey suggests more consistent solution, that would also disallow enums and longs. That would require explicit static_cast<> in several places throughout our code. I found this a bit unrequested effect.
> > What would you say?

> I think adding explicit type casts for longs would be fine as we can loose precision in those places and should probably switch the code from long to int or fix the protocol. As for the enums - all of them a generated and we could generate no_implicit_cast specializations for them as a bonus we wouldn't be able to pass enum values not from the protocol to the protocol messages. What do you think?

Enums are not generated, all enums in question are hand-written. Disallowing implicit casts for them is not a problem. Quite opposite, I worked for allowing implicit casts for them.
If you feel like it's ok to do explicit casts for enums and longs, I'm fine. 

That would make my part easier. My concerns were about burdening the codebase with out-of-nowhere casts.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list