From: Tom Hacohen <tom.hacohen@pa...> - 2011-08-24 14:11:32
On 24/08/11 17:09, Tom Hacohen wrote:
> On 24/08/11 17:04, Gustavo Sverzut Barbieri wrote:
>> On Wed, Aug 24, 2011 at 5:10 AM, Enlightenment SVN<
>> no-reply@...> wrote:
>>> elm toolbar: Fixed build warnings.
>>> - char *txt = item->access_info;
>>> + char *txt = (char *)item->access_info;
>>> if (!txt) txt = (char *)it->label;
>>> if (txt) return strdup(txt);
>>> return txt;
>> Hey Seoz, don't fix the bugs like this... it is not wrong, but not
>> recommended to fix the problem at the wrong place.
>> Consider the following solution:
>> const char *txt = item->access_info;
>> if (!txt) txt = it->label;
>> if (txt) return strdup(txt);
>> return NULL;
>> no cast abuse, make it clear of the usage and the return of NULL.
>> moreover, the function signature has item marked as __UNUSED__ while it's
>> being used... pfff :-/
> +1. We enable/fix warnings because we want to detect bad usage, not make
> the compilers silence no matter what your cflags are. Just casting is
> bad, very bad, and can lead to errors. Same goes with mike's comment
> about __UNUSED__.
Hm... Gustavo's comment, wth, for some reason I thought it was mike.