[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
Thu May 24 05:59:03 PDT 2012


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





--- Comment #9 from Yury Semikhatsky <yurys at chromium.org>  2012-05-24 05:58:07 PST ---
(In reply to comment #8)
> (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.
Do you have an estimate on how many enums are passed as integers through the protocol(should be easy to detect them with the compiler)? As Andrey suggests we should probably use enums explicitly declared in the protocol instead in those cases.

-- 
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