[Lldb-commits] [PATCH] D11745: [debugserver] Fix "control may reach end of non-void function" warnings.

Bruce Mitchener bruce.mitchener at gmail.com
Mon Aug 3 20:34:48 PDT 2015


brucem created this revision.
brucem added reviewers: clayborg, jingham.
brucem added a subscriber: lldb-commits.

http://reviews.llvm.org/D11745

Files:
  tools/debugserver/source/MacOSX/i386/DNBArchImplI386.cpp
  tools/debugserver/source/MacOSX/x86_64/DNBArchImplX86_64.cpp

Index: tools/debugserver/source/MacOSX/x86_64/DNBArchImplX86_64.cpp
===================================================================
--- tools/debugserver/source/MacOSX/x86_64/DNBArchImplX86_64.cpp
+++ tools/debugserver/source/MacOSX/x86_64/DNBArchImplX86_64.cpp
@@ -680,9 +680,9 @@
         return (0x3 << 2) | rw;
     case 8:
         return (0x2 << 2) | rw;
-    default:
-        assert(0 && "invalid size, must be one of 1, 2, 4, or 8");
     }    
+    assert(0 && "invalid size, must be one of 1, 2, 4, or 8");
+    return 0;
 }
 void
 DNBArchImplX86_64::SetWatchpoint(DBG &debug_state, uint32_t hw_index, nub_addr_t addr, nub_size_t size, bool read, bool write)
@@ -794,9 +794,9 @@
         return debug_state.__dr2;
     case 3:
         return debug_state.__dr3;
-    default:
-        assert(0 && "invalid hardware register index, must be one of 0, 1, 2, or 3");
     }
+    assert(0 && "invalid hardware register index, must be one of 0, 1, 2, or 3");
+    return 0;
 }
 
 bool
Index: tools/debugserver/source/MacOSX/i386/DNBArchImplI386.cpp
===================================================================
--- tools/debugserver/source/MacOSX/i386/DNBArchImplI386.cpp
+++ tools/debugserver/source/MacOSX/i386/DNBArchImplI386.cpp
@@ -734,10 +734,11 @@
         return (0x3 << 2) | rw;
     case 8:
         return (0x2 << 2) | rw;
-    default:
-        assert(0 && "invalid size, must be one of 1, 2, 4, or 8");
     }    
+    assert(0 && "invalid size, must be one of 1, 2, 4, or 8");
+    return 0;
 }
+
 void
 DNBArchImplI386::SetWatchpoint(DBG &debug_state, uint32_t hw_index, nub_addr_t addr, nub_size_t size, bool read, bool write)
 {
@@ -849,9 +850,9 @@
         return debug_state.__dr2;
     case 3:
         return debug_state.__dr3;
-    default:
-        assert(0 && "invalid hardware register index, must be one of 0, 1, 2, or 3");
     }
+    assert(0 && "invalid hardware register index, must be one of 0, 1, 2, or 3");
+    return 0;
 }
 
 bool


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D11745.31293.patch
Type: text/x-patch
Size: 1981 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20150804/548415b2/attachment.bin>


More information about the lldb-commits mailing list