[Lldb-commits] [lldb] r213715 - Target: silence a GCC warning

Saleem Abdulrasool compnerd at compnerd.org
Tue Jul 22 18:53:52 PDT 2014


Author: compnerd
Date: Tue Jul 22 20:53:52 2014
New Revision: 213715

URL: http://llvm.org/viewvc/llvm-project?rev=213715&view=rev
Log:
Target: silence a GCC warning

GCC emits a warning:
    warning: enumeral and non-enumeral type in conditional expression [enabled by default]
which does not seem to have a flag to control it.  Simply add an explicit cast
for the boolean value.

Modified:
    lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
    lldb/trunk/source/Target/Target.cpp

Modified: lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp?rev=213715&r1=213714&r2=213715&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp (original)
+++ lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp Tue Jul 22 20:53:52 2014
@@ -2243,7 +2243,9 @@ ObjectFileMachO::ParseSymtab ()
 
         const size_t function_starts_count = function_starts.GetSize();
 
-        const user_id_t TEXT_eh_frame_sectID = eh_frame_section_sp.get() ? eh_frame_section_sp->GetID() : NO_SECT;
+        const user_id_t TEXT_eh_frame_sectID =
+            eh_frame_section_sp.get() ? eh_frame_section_sp->GetID()
+                                      : static_cast<user_id_t>(NO_SECT);
 
         lldb::offset_t nlist_data_offset = 0;
 

Modified: lldb/trunk/source/Target/Target.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/Target.cpp?rev=213715&r1=213714&r2=213715&view=diff
==============================================================================
--- lldb/trunk/source/Target/Target.cpp (original)
+++ lldb/trunk/source/Target/Target.cpp Tue Jul 22 20:53:52 2014
@@ -486,9 +486,12 @@ Target::CreateFuncRegexBreakpoint (const
                                    bool hardware)
 {
     SearchFilterSP filter_sp(GetSearchFilterForModuleAndCUList (containingModules, containingSourceFiles));
+    bool skip =
+      (skip_prologue == eLazyBoolCalculate) ? GetSkipPrologue()
+                                            : static_cast<bool>(skip_prologue);
     BreakpointResolverSP resolver_sp(new BreakpointResolverName (NULL, 
                                                                  func_regex, 
-                                                                 skip_prologue == eLazyBoolCalculate ? GetSkipPrologue() : skip_prologue));
+                                                                 skip));
 
     return CreateBreakpoint (filter_sp, resolver_sp, internal, hardware, true);
 }





More information about the lldb-commits mailing list