|
From: | Juergen Sauermann |
Subject: | Re: [Bug-apl] clang Warning - revisited |
Date: | Sat, 19 Apr 2014 14:37:53 +0200 |
User-agent: | Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20130330 Thunderbird/17.0.5 |
Hi Peter,
I have changed it in SVN 215. I still disagree with the warning because in a comparison of an enumeration member with an integer should perform integer promotion of the enum member to int and then do integer comparison and NOT convert the int to an enum member (which it can't) and then do the comparison (or issue the warning). In other words, I read "l < 10" as "(int)l < 10" (which can be true or false) and not as "l < (Function_line)10" which can also be true or false because if I allow implicit (Function_line)10 then I cannot rule out (Function_line)42 either. The really interesting question is if the compiler would optimize "if (i < 10)" away which I would consider a fault in the compiler. As a warning it is just a bit annoying because it forces "default: ;" all over the place. /// Jürgen On 04/19/2014 02:36 AM, Peter Teeson wrote:
|
[Prev in Thread] | Current Thread | [Next in Thread] |