Fix more clang build warnings
authorBen Woodard <woodard@redhat.com>
Thu, 11 May 2017 23:30:20 +0000 (16:30 -0700)
committerDodji Seketeli <dodji@redhat.com>
Fri, 2 Jun 2017 21:12:14 +0000 (23:12 +0200)
* include/abg-ini.h (config::section::priv): Make this be a class,
not a struct.
* src/abg-dwarf-reader.cc (build_translation_unit_and_add_to_ir)
(build_ir_node_from_die): Add parenthesis around assignment
expressions inside conditional expression.
* src/abg-suppression.cc (read_function_suppression): Likewise.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
include/abg-ini.h
src/abg-dwarf-reader.cc
src/abg-suppression.cc

index bd4ed520944c26700a0156e5d58be878a2acd762..3c7faba3a51adb513e41112ab9fcfaf168cdadfc 100644 (file)
@@ -392,7 +392,7 @@ public:
 /// The abstraction of one section of the .ini config.
 class config::section
 {
-  struct priv;
+  class priv;
   typedef shared_ptr<priv> priv_sptr;
 
   priv_sptr priv_;
index c8c21e09e88d0314aa1269436b49a42cd971d593..ba69295015ec30ef550df45236c875c4f9a4285e 100644 (file)
@@ -10294,7 +10294,7 @@ build_translation_unit_and_add_to_ir(read_context&      ctxt,
                // variable definition from its current non-class
                // scope ...
                decl_base_sptr d;
-               if (d = lookup_var_decl_in_scope(mem_name, class_type))
+               if ((d = lookup_var_decl_in_scope(mem_name, class_type)))
                  // This is the data member with the same name in cl.
                  // We just need to flag it as static.
                  ;
@@ -12933,8 +12933,8 @@ build_ir_node_from_die(read_context&    ctxt,
   die_source source_of_die;
   assert(ctxt.get_die_source(die, source_of_die));
 
-  if (result = ctxt.lookup_decl_from_die_offset(dwarf_dieoffset(die),
-                                               source_of_die))
+  if ((result = ctxt.lookup_decl_from_die_offset(dwarf_dieoffset(die),
+                                                source_of_die)))
     return result;
 
   switch (tag)
index 8d25f6594d3eed56874287bdebc3cdb4b6dae403..8bb6a61026c48988521e1a313fe781c8fbb62afe 100644 (file)
@@ -3039,8 +3039,8 @@ read_function_suppression(const ini::config::section& section)
       {
        ini::simple_property_sptr prop = is_simple_property(*p);
        assert(prop);
-       if (parm = read_parameter_spec_from_string
-           (prop->get_value()->as_string()))
+       if ((parm = read_parameter_spec_from_string
+             (prop->get_value()->as_string())))
          parms.push_back(parm);
       }