Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/gnu/dist/toolchain/gdb Fix a "comparison always true" warnin...



details:   https://anonhg.NetBSD.org/src/rev/7709a9ce805e
branches:  trunk
changeset: 526581:7709a9ce805e
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Mon May 06 18:22:11 2002 +0000

description:
Fix a "comparison always true" warning from gcc-current.

diffstat:

 gnu/dist/toolchain/gdb/dwarfread.c |  11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diffs (21 lines):

diff -r cc1c244b1b24 -r 7709a9ce805e gnu/dist/toolchain/gdb/dwarfread.c
--- a/gnu/dist/toolchain/gdb/dwarfread.c        Mon May 06 17:59:18 2002 +0000
+++ b/gnu/dist/toolchain/gdb/dwarfread.c        Mon May 06 18:22:11 2002 +0000
@@ -3316,11 +3316,12 @@
          complain (&volatile_ignored, DIE_ID, DIE_NAME);       /* FIXME */
          break;
        default:
-         if (!(MOD_lo_user <= (unsigned char) modifier
-               && (unsigned char) modifier <= MOD_hi_user))
-           {
-             complain (&unknown_type_modifier, DIE_ID, DIE_NAME, modifier);
-           }
+         /* No need to test against MOD_hi_user (0xff); since we're
+            doing an unsigned 8-bit test, the comparison will always
+            be true.  */
+         if ((unsigned char) modifier < MOD_lo_user
+         /* || (unsigned char) > MOD_hi_user */)
+           complain (&unknown_type_modifier, DIE_ID, DIE_NAME, modifier);
          break;
        }
     }



Home | Main Index | Thread Index | Old Index