[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 21:01:57 PDT 2015


This revision was automatically updated to reflect the committed changes.
Closed by commit rL243953: [debugserver] Fix "control may reach end of non-void function" warnings. (authored by brucem).

Changed prior to commit:
  http://reviews.llvm.org/D11745?vs=31293&id=31296#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D11745

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

Index: lldb/trunk/tools/debugserver/source/MacOSX/x86_64/DNBArchImplX86_64.cpp
===================================================================
--- lldb/trunk/tools/debugserver/source/MacOSX/x86_64/DNBArchImplX86_64.cpp
+++ lldb/trunk/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: lldb/trunk/tools/debugserver/source/MacOSX/i386/DNBArchImplI386.cpp
===================================================================
--- lldb/trunk/tools/debugserver/source/MacOSX/i386/DNBArchImplI386.cpp
+++ lldb/trunk/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.31296.patch
Type: text/x-patch
Size: 2047 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20150804/4d3a7991/attachment.bin>


More information about the lldb-commits mailing list