# HG changeset patch # User William Astle # Date 1432705320 21600 # Node ID d149e2b56981bc15f90dddac7e02a3cd8b3d1b37 # Parent 4130ffdeb5c86962443fe311db3e4913fc9eaec7 Silence tautological comparison warnings Because "char" may be signed or unsigned depending on the system, comparing for byte values 128...255 has to be forced as an unsigned comparison to be portable and clear. Modify two such comparisons in the symbol handling code to treat the symbol offset as a pointer to unsigned. This quiets tautological comparison warnings on systems with an 8 bit signed type as the default char type. diff -r 4130ffdeb5c8 -r d149e2b56981 lwasm/symbol.c --- a/lwasm/symbol.c Tue May 26 17:53:51 2015 -0600 +++ b/lwasm/symbol.c Tue May 26 23:42:00 2015 -0600 @@ -93,7 +93,7 @@ lwasm_register_error(as, cl, "Bad symbol (%s)", sym); return NULL; } - if (*sym < 0x80 && (!strchr(SSYMCHARS, *sym) && !strchr(sym + 1, '$') && !strchr(sym + 1, '@') && !strchr(sym + 1, '?'))) + if (*(unsigned char *)sym < 0x80 && (!strchr(SSYMCHARS, *sym) && !strchr(sym + 1, '$') && !strchr(sym + 1, '@') && !strchr(sym + 1, '?'))) { lwasm_register_error(as, cl, "Bad symbol (%s)", sym); return NULL; @@ -114,7 +114,7 @@ islocal = 1; // bad symbol - if (!(flags & symbol_flag_nocheck) && *cp < 0x80 && !strchr(SYMCHARS, *cp)) + if (!(flags & symbol_flag_nocheck) && *(unsigned char *)cp < 0x80 && !strchr(SYMCHARS, *cp)) { lwasm_register_error(as, cl, "Bad symbol (%s)", sym); return NULL;