This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[fixme] no-effect expression in assert
- From: Michael Snyder <msnyder at vmware dot com>
- To: "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>, "tromey at redhat dot com" <tromey at redhat dot com>
- Date: Sat, 26 Feb 2011 14:21:15 -0800
- Subject: [fixme] no-effect expression in assert
Tom,
Coverity points out that dest_offset_bits, being unsigned, is always >=
zero. What would you think about dropping that from the assert?
Thanks,
Michael
Index: dwarf2loc.c
===================================================================
RCS file: /cvs/src/src/gdb/dwarf2loc.c,v
retrieving revision 1.109
diff -u -p -u -p -r1.109 dwarf2loc.c
--- dwarf2loc.c 25 Feb 2011 08:35:36 -0000 1.109
+++ dwarf2loc.c 26 Feb 2011 22:18:59 -0000
@@ -422,7 +422,7 @@ insert_bits (unsigned int datum,
{
unsigned int mask;
- gdb_assert (dest_offset_bits >= 0 && dest_offset_bits + nbits <= 8);
+ gdb_assert (dest_offset_bits + nbits <= 8);
mask = (1 << nbits) - 1;
if (bits_big_endian)