Patch installed to zap java warning

Kaveh R. Ghazi ghazi@caip.rutgers.edu
Wed Jun 26 13:13:00 GMT 2002


This patch fixes:
 > java/lex.c:498: warning: comparison is always true due to limited range of data type
 > java/lex.c:498: warning: comparison is always true due to limited range of data type

Bootstrapped and tested on sparc-sun-solaris2.7, no regressions.

Installed as obvious.



2002-06-25  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>

	* lex.c (java_read_char): Avoid "comparison is always true"
	warning.

diff -rup orig/egcc-CVS20020624/gcc/java/lex.c egcc-CVS20020624/gcc/java/lex.c
--- orig/egcc-CVS20020624/gcc/java/lex.c	2002-06-11 16:01:40.000000000 -0400
+++ egcc-CVS20020624/gcc/java/lex.c	2002-06-25 11:11:19.848766451 -0400
@@ -494,8 +494,8 @@ java_read_char (lex)
 						 + (c2 & 0x3f));
 		      /* Check for valid 3-byte characters.
 			 Don't allow surrogate, \ufffe or \uffff.  */
-		      if (r >= 0x800 && r <= 0xffff
-			  && ! (r >= 0xd800 && r <= 0xdfff)
+		      if (IN_RANGE (r, 0x800, 0xffff)
+			  && ! IN_RANGE (r, 0xd800, 0xdfff)
 			  && r != 0xfffe && r != 0xffff)
 			return r;
 		    }



More information about the Java-patches mailing list