[webkit-efl] Issues from static program analysis tool(s)

Rafael Antognolli antognolli at profusion.mobi
Thu Jul 28 05:47:37 PDT 2011


On Thu, Jul 28, 2011 at 4:24 AM, Kangil Han <kangil.han at samsung.com> wrote:
> Dear EFL developers,
>
>
>
> I am writing this to hear your voices on the issues from static program
> analysis tool.
>
> ‘Coverity Static Analysis’ can be a tool of those.
>
>
>
> For example, lately I’ve got a below report.
>
> There should be null check for ‘o’ in ‘EWK_VIEW_SD_GET(o, ptr)’ macro.
>
>
>
>
>
> #define EWK_VIEW_SD_GET(o, ptr)                                 \
>
>     Ewk_View_Smart_Data* ptr =
> (Ewk_View_Smart_Data*)evas_object_smart_data_get(o)
>
>
>
> If we only look at this macro, report seems clear.
>
> But, when it comes to look ellE>evas_object_smart_data_get’ function, this
> point is not so clear.
>
> This is because ‘evas_object_smart_data_get’ function can handle NULL
> argument of ‘o’.
>
> However, if we should have strict view in programming, this report makes
> sense.

Why?

What do you mean by "strict view in programming"?

This macro considers that NULL is a valid value for 'o', because the
function evas_object_smart_data_get() can handle it (by checking it
internally). What benefits do you have by double checking this?

For me, that's just a false positive of the static analysis.

Regards,
-- 
Rafael Antognolli
ProFUSION embedded systems
http://profusion.mobi


More information about the webkit-efl mailing list