From: Gustavo S. B. <bar...@pr...> - 2009-09-01 10:50:45
|
On Tue, Sep 1, 2009 at 7:43 AM, Viktor Kojouharov<vko...@gm...> wrote: > On Tue, 2009-09-01 at 07:35 -0300, Gustavo Sverzut Barbieri wrote: >> On Mon, Aug 31, 2009 at 9:39 PM, Enlightenment >> SVN<no-...@en...> wrote: >> > Log: >> > silence clang warnings >> ... >> > Modified: trunk/E-MODULES-EXTRA/drawer/src/plugins/views/list.c >> > =================================================================== >> > --- trunk/E-MODULES-EXTRA/drawer/src/plugins/views/list.c 2009-08-31 21:04:13 UTC (rev 42140) >> > +++ trunk/E-MODULES-EXTRA/drawer/src/plugins/views/list.c 2009-09-01 00:39:26 UTC (rev 42141) >> > @@ -290,6 +290,9 @@ >> > } >> > e = _list_horizontal_entry_create(inst, si); >> > break; >> > + default: >> > + e = NULL; >> > + break; >> > } >> > inst->entries = eina_list_append(inst->entries, e); >> > e_box_pack_end(inst->o_box, e->o_holder); >> >> silence is not good, this last hunk will likely introduce a bug since >> you're appending e == NULL to inst->entries and likely a new run of >> the CLang static checker will point out you just introduced a NULL >> pointer dereference in the line following it: e->o_holder == CRASH! >> >> Please take care to not silence problems and introduce a new, tricker >> bug! (it would be the case with inst->entries containing data == NULL, >> we'd have to check for data != NULL in every place and possible fail >> once and screw, it's much more safe avoiding NULL pointers to get into >> the list. > > the default path is technically impossible, but I added it just to > silence the warning. But I'll take care not to add null entries as well. it's better to have a log + return then, maybe users hit it using some way? -- Gustavo Sverzut Barbieri http://profusion.mobi embedded systems -------------------------------------- MSN: bar...@gm... Skype: gsbarbieri Mobile: +55 (19) 9225-2202 |