[webkit-dev] Type cast by using toFoo()
kasibhatla.ravi at gmail.com
Tue Oct 1 05:36:20 PDT 2013
I am the original author of style checker patch reported in previous mail
My logic for checking the error is simple:
- In the patch, I check for any line which contains regex static_cast<Foo*>.
- If line does contain it, I pick the regex part Foo and search for Foo.h
in the codebase.
- In Foo.h, I check for toFoo signature and if it is present, I ask the
user to use it. If the signature is not present, I throw the message of
adding the toFoo() and using it.
- In cases, where Foo.h is not found, I don't report any error (which I
plan to look in future for more refining).
I have raised the bug https://bugs.webkit.org/show_bug.cgi?id=122156 for
tracking this change in WebKit and will soon be porting the patch which got
committed in blink (
On Tue, Oct 1, 2013 at 11:22 AM, Gyuyoung Kim <gyuyoung.kim at webkit.org>wrote:
> My plan is to show style error when submitted patch doesn't use toFoo()
> though toFoo exists. This idea was originated from blink commit. However,
> it was reverted because of some regression.
> If my understanding is correct, the toFoo() style checker checks if there
> is toFoo() in a class. If uploaded patch uses static_cast<> instead of
> toFoo() though there is toFoo(), style checker will generate style error.
> Anyway, I think I need to investigate the commit and consider the idea
> On Tue, Oct 1, 2013 at 3:20 AM, Ryosuke Niwa <rniwa at webkit.org> wrote:
>> On Mon, Sep 30, 2013 at 10:52 AM, Yong Li <yong.li.webkit at outlook.com>wrote:
>>> Bottom line is turning on RTTI in debug build?
>> Style checker analyzes the code statically. It's nothing to do with
>> runtime assertions. If that wasn't clear enough, style check happens
>> before WebKit is ever built.
>> - R. Niwa
>> webkit-dev mailing list
>> webkit-dev at lists.webkit.org
> webkit-dev mailing list
> webkit-dev at lists.webkit.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the webkit-dev