public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [fixme] no-effect expression in assert
@ 2011-02-26 22:31 Michael Snyder
  2011-02-28 15:41 ` Tom Tromey
  0 siblings, 1 reply; 2+ messages in thread
From: Michael Snyder @ 2011-02-26 22:31 UTC (permalink / raw)
  To: gdb-patches, tromey

[-- Attachment #1: Type: text/plain, Size: 162 bytes --]

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


[-- Attachment #2: noeffect.txt --]
[-- Type: text/plain, Size: 536 bytes --]

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)

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [fixme] no-effect expression in assert
  2011-02-26 22:31 [fixme] no-effect expression in assert Michael Snyder
@ 2011-02-28 15:41 ` Tom Tromey
  0 siblings, 0 replies; 2+ messages in thread
From: Tom Tromey @ 2011-02-28 15:41 UTC (permalink / raw)
  To: Michael Snyder; +Cc: gdb-patches

>>>>> "Michael" == Michael Snyder <msnyder@vmware.com> writes:

Michael> Coverity points out that dest_offset_bits, being unsigned, is always
Michael> >= zero.  What would you think about dropping that from the assert?

That is fine by me.

Tom

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-02-28 15:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-02-26 22:31 [fixme] no-effect expression in assert Michael Snyder
2011-02-28 15:41 ` Tom Tromey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).