-
Bug
-
Resolution: Not an Issue
-
P5
-
9
I am getting this warning from some (closed source) code in the JDK Linux build
warning: comparison is always false due to limited range of data type [-Wtype-limits]
The code in question is using enums as in
enum myenum { v1, v2, v3, v4);
myenum val;
...
..
if ( val < v1) { problem }} ;
So the code seems reasonable
I found a discussion here :-
http://gcc.gnu.org/ml/gcc-patches/2012-05/msg00972.html
and it also seems that this ...
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51712
added the new option : fno-short-enums
I doubt that's supported yet by the gcc we use but the later comments
conclude that should not have been needed as the warning really
should not be raised anyway.
I'm filing this mainly for documentation purposes.
I'm not sure what we can do to suppress it now other than disable this class of warning.
warning: comparison is always false due to limited range of data type [-Wtype-limits]
The code in question is using enums as in
enum myenum { v1, v2, v3, v4);
myenum val;
...
..
if ( val < v1) { problem }} ;
So the code seems reasonable
I found a discussion here :-
http://gcc.gnu.org/ml/gcc-patches/2012-05/msg00972.html
and it also seems that this ...
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51712
added the new option : fno-short-enums
I doubt that's supported yet by the gcc we use but the later comments
conclude that should not have been needed as the warning really
should not be raised anyway.
I'm filing this mainly for documentation purposes.
I'm not sure what we can do to suppress it now other than disable this class of warning.