Blob Blame History Raw
commit cbf3b6e6ac7d26d6667b306b9d8677678624bec8
Author: Frank Ch. Eigler <fche@redhat.com>
Date:   Thu Nov 15 22:02:18 2018 -0500

    bpf-translate.cxx: quiet a compiler warning
    
    It's a false positive with rawhide gcc, but easy to quiet anyway.

diff --git a/bpf-translate.cxx b/bpf-translate.cxx
index b382a2e..78a5a8d 100644
--- a/bpf-translate.cxx
+++ b/bpf-translate.cxx
@@ -1150,6 +1150,7 @@ bpf_unparser::emit_asm_opcode (const asm_stmt &stmt,
                                 stmt.fallthrough.c_str()), stmt.tok);
       block *target = label_map[stmt.jmp_target];
       block *fallthrough = label_map[stmt.fallthrough];
+      c = EQ; // defeat compiler warning about uninitialized c
       this_prog.mk_jcond(this_ins, c, v_dest, v_src1, target, fallthrough);
     }
   else // regular opcode

commit e6227e5df0851bea0e5a94b17fe0a82c280ed600
Author: Serhei Makarov <smakarov@redhat.com>
Date:   Fri Nov 16 12:12:07 2018 -0500

    bpf-translate.cxx: don't clobber any earlier value of c

diff --git a/bpf-translate.cxx b/bpf-translate.cxx
index 78a5a8d..92f0ea4 100644
--- a/bpf-translate.cxx
+++ b/bpf-translate.cxx
@@ -1027,7 +1027,8 @@ bpf_unparser::emit_asm_opcode (const asm_stmt &stmt,
     throw SEMANTIC_ERROR (_("invalid bpf code"), stmt.tok);
 
   bool r_dest = false, r_src0 = false, r_src1 = false, i_src1 = false;
-  bool op_jmp = false, op_jcond = false; condition c;
+  bool op_jmp = false, op_jcond = false;
+  condition c = EQ; // <- quiet a compiler warning about uninitialized c
   switch (BPF_CLASS (stmt.code))
     {
     case BPF_LDX:
@@ -1150,7 +1151,6 @@ bpf_unparser::emit_asm_opcode (const asm_stmt &stmt,
                                 stmt.fallthrough.c_str()), stmt.tok);
       block *target = label_map[stmt.jmp_target];
       block *fallthrough = label_map[stmt.fallthrough];
-      c = EQ; // defeat compiler warning about uninitialized c
       this_prog.mk_jcond(this_ins, c, v_dest, v_src1, target, fallthrough);
     }
   else // regular opcode