Hi,

Today compiling efl with clang some warnings shows. While there are
some false alarms with EINA_INLINE macros (I'll try to check what to
do about those), some are valid.

== eet_chipher.c eet_decipher() ==
lib/eet/eet_cipher.c:1096:8: warning: variable 'opened' is used uninitialized
      whenever 'if' condition is true [-Wsometimes-uninitialized]
   if (!ret)
       ^~~~
lib/eet/eet_cipher.c:1180:8: note: uninitialized use occurs here
   if (opened)
       ^~~~~~
lib/eet/eet_cipher.c:1096:4: note: remove the 'if' if its condition is always
      false
   if (!ret)
   ^~~~~~~~~
lib/eet/eet_cipher.c:1092:8: warning: variable 'opened' is used uninitialized
      whenever 'if' condition is true [-Wsometimes-uninitialized]
   if ((tmp_len & 0x1F) != 0)
       ^~~~~~~~~~~~~~~~~~~~~
lib/eet/eet_cipher.c:1180:8: note: uninitialized use occurs here
   if (opened)
       ^~~~~~
lib/eet/eet_cipher.c:1092:4: note: remove the 'if' if its condition is always
      false
   if ((tmp_len & 0x1F) != 0)
   ^~~~~~~~~~~~~~~~~~~~~~~~~~
lib/eet/eet_cipher.c:1130:4: note: variable 'opened' is declared here
   int opened = 0;
   ^
2 warnings generated.


this file is a horror story of using 2 systems. It's leaking the ssl
and gnutls stuff with the goto on_error. The first 'if (!ret) goto
error' happens BEFORE opened was declared... but goto uses that.

Who wrote this file please rewrite this bit using 2 different
functions, one for gnutls and another for openssl, handle memory and
errors right. Then call them from eet_decipher().


== evas_image_load_psd.c ==
bin/evas/loaders/psd/evas_image_load_psd.c:374:70: warning: expression result
      unused [-Wunused-value]
                       for (x = 0; x < (unsigned int)bps2; x += bpp, shortptr)
                                                                     ^~~~~~~~
1 warning generated.

shortptr is in the for(), but not being changed. Later on in the code it does:

                            newval = *shortptr * ((unsigned
short*)data)[y + x + 3];

using the same ptr. Likely shortptr needs to be incremented, but who
wrote this code please check.

This error is also present in modules/evas/loaders/psd/evas_image_load_psd.c


== dns.c ==

horror story, warnings everywhere, with gcc, clang... can't we have a
sane dns implementation? I know we got this from someone else, but
what's the difficulty in doing it with our tech?

== ecore_x_randr_12.c ==
lib/ecore_x/xlib/ecore_x_randr_12.c:1204:30: warning: comparison of constant
      4294967295 with expression of type 'Ecore_X_Randr_Orientation' (aka 'enum
      _Ecore_X_Randr_Orientation') is always false
      [-Wtautological-constant-out-of-range-compare]
             if (orientation == Ecore_X_Randr_Unset)

unset is -1, while orientation is an enum without that value. Some
compilers will just remove this check, as the value can't exist.
Either convert orientation to 'int' (be warned of ABI break), or add
Ecore_X_Randr_Unset to enum (also should break ABI).


== edje_entry.c ==
lots of conversion that are suspicious. We need to check if the enums
match perfectly:

lib/edje/edje_entry.c:2921:62: warning: implicit conversion from enumeration
      type 'Edje_Text_Autocapital_Type' (aka 'enum _Edje_Text_Autocapital_Type')
      to different enumeration type 'Ecore_IMF_Autocapital_Type'
      [-Wenum-conversion]
     ecore_imf_context_autocapital_type_set(en->imf_context, autocapital_type);
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                  ^~~~~~~~~~~~~~~~
lib/edje/edje_entry.c:2940:13: warning: implicit conversion from enumeration
      type 'Ecore_IMF_Autocapital_Type' to different enumeration type
      'Edje_Text_Autocapital_Type' (aka 'enum _Edje_Text_Autocapital_Type')
      [-Wenum-conversion]
     return ecore_imf_context_autocapital_type_get(en->imf_context);
     ~~~~~~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
lib/edje/edje_entry.c:3050:66: warning: implicit conversion from enumeration
      type 'Edje_Input_Panel_Lang' (aka 'enum _Edje_Input_Panel_Lang') to
      different enumeration type 'Ecore_IMF_Input_Panel_Lang'
      [-Wenum-conversion]
     ecore_imf_context_input_panel_language_set(en->imf_context, lang);
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                  ^~~~
lib/edje/edje_entry.c:3115:73: warning: implicit conversion from enumeration
      type 'Edje_Input_Panel_Return_Key_Type' (aka 'enum
      _Edje_Input_Panel_Return_Key_Type') to different enumeration type
      'Ecore_IMF_Input_Panel_Return_Key_Type' [-Wenum-conversion]
     ecore_imf_context_input_panel_return_key_type_set(en->imf_context,
return_key_type);
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 ^~~~~~~~~~~~~~~
lib/edje/edje_entry.c:3133:13: warning: implicit conversion from enumeration
      type 'Ecore_IMF_Input_Panel_Return_Key_Type' to different enumeration type
      'Edje_Input_Panel_Return_Key_Type' (aka 'enum
      _Edje_Input_Panel_Return_Key_Type') [-Wenum-conversion]
     return ecore_imf_context_input_panel_return_key_type_get(en->imf_context);
     ~~~~~~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
lib/edje/edje_entry.c:3546:64: warning: implicit conversion from enumeration
      type 'Edje_Input_Panel_Layout' (aka 'enum _Edje_Input_Panel_Layout') to
      different enumeration type 'Ecore_IMF_Input_Panel_Layout'
      [-Wenum-conversion]
     ecore_imf_context_input_panel_layout_set(en->imf_context, layout);
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                  ^~~~~~
lib/edje/edje_entry.c:3564:13: warning: implicit conversion from enumeration
      type 'Ecore_IMF_Input_Panel_Layout' to different enumeration type
      'Edje_Input_Panel_Layout' (aka 'enum _Edje_Input_Panel_Layout')
      [-Wenum-conversion]
     return ecore_imf_context_input_panel_layout_get(en->imf_context);
     ~~~~~~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
7 warnings generated.

== edje_load.c ==

Similar to edje_entry.c, need to check if the enums match.

lib/edje/edje_load.c:1773:53: warning: implicit conversion from enumeration type
      'Edje_Aspect_Control' (aka 'enum _Edje_Aspect_Control') to different
      enumeration type 'Evas_Aspect_Control' (aka 'enum _Evas_Aspect_Control')
      [-Wenum-conversion]
   evas_object_size_hint_aspect_set(obj, it->aspect.mode, it->aspect.w,...
   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~      ~~~~~~~~~~~^~~~

== eeze_scanner.c ==

Abuse of some variables? I don't get the logic in there, clang doesn't as well:
bin/eeze/eeze_scanner.c:298:43: warning: implicit conversion from enumeration
      type 'Eeze_Scanner_Event_Type' to different enumeration type
      'Eeze_Udev_Event' [-Wenum-conversion]
   if (ev == EEZE_UDEV_EVENT_ONLINE) ev = EEZE_SCANNER_EVENT_TYPE_ADD;
                                        ~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~
bin/eeze/eeze_scanner.c:299:49: warning: implicit conversion from enumeration
      type 'Eeze_Scanner_Event_Type' to different enumeration type
      'Eeze_Udev_Event' [-Wenum-conversion]
   else if (ev == EEZE_UDEV_EVENT_OFFLINE) ev = EEZE_SCANNER_EVENT_TYPE_REMOVE;
                                              ~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
bin/eeze/eeze_scanner.c:301:23: warning: implicit conversion from enumeration
      type 'Eeze_Udev_Event' to different enumeration type
      'Eeze_Scanner_Event_Type' [-Wenum-conversion]
   event_send(device, ev, EINA_TRUE);
   ~~~~~~~~~~         ^~
bin/eeze/eeze_scanner.c:347:30: warning: implicit conversion from enumeration
      type 'Eeze_Udev_Event' to different enumeration type
      'Eeze_Scanner_Event_Type' [-Wenum-conversion]
          event_send(device, ev, EINA_FALSE);
          ~~~~~~~~~~         ^~
bin/eeze/eeze_scanner.c:370:30: warning: implicit conversion from enumeration
      type 'Eeze_Udev_Event' to different enumeration type
      'Eeze_Scanner_Event_Type' [-Wenum-conversion]
          event_send(device, ev, EINA_FALSE);
          ~~~~~~~~~~         ^~

Would be nice if someone could check those.

--
Gustavo Sverzut Barbieri
http://profusion.mobi embedded systems
--------------------------------------
MSN: barbi...@gmail.com
Skype: gsbarbieri
Mobile: +55 (19) 9225-2202

------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only -- learn more at:
http://p.sf.net/sfu/learnmore_123012
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to