This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[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)

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]