There is a workaround to avoid the warning though, and that is to do a
static_cast<int> of the enum when you do the comparison. That was the
recommendation when I was googling about this issue.

Regards,
Elias


On 21 April 2014 18:24, Juergen Sauermann <juergen.sauerm...@t-online.de>wrote:

>  Hi Vladimir,
>
> thanks. Not sure if you can do anything about the text of the warning,
> If so, then my proposal would be "comparison *may *always be true because
> all declarators in enum XXX are smaller than int 10" or so.
>
> /// Jürgen
>
>
> On 04/21/2014 09:19 AM, Vladimir Ur wrote:
>
> Juergen, hmm, ok. I agree that warning text is too strict and may be 
> misleading.
>
> But I think it is so not because of type cast in comparison
> (byte <= UCHAR_MAX should also be always true, even if byte promoted to int),
> but because enum is at least int by definition in standard.
>
> Anyway thank you for great project.
>
> On Sun, 20 Apr 2014 11:54:53 +0200
> Juergen Sauermann <juergen.sauerm...@t-online.de> 
> <juergen.sauerm...@t-online.de> wrote:
>
>
>

Reply via email to