]> The Tcpdump Group git mirrors - libpcap/commitdiff
See if *this* squelches the "clobbered by longjmp" warnings.
authorGuy Harris <[email protected]>
Sat, 10 Nov 2018 22:30:31 +0000 (14:30 -0800)
committerGuy Harris <[email protected]>
Sat, 10 Nov 2018 22:30:31 +0000 (14:30 -0800)
Trying to fix some other ones that popped up causes an annoying cascade
of "volatile" being plastered all over the code, including grammar.y.
This is just not acceptable.

gencode.c
gencode.h

index ab862641164858f8f5e9e4f997eb30549bc18c52..6ff3de8262acae62de56e7165aa1b1bb7763315b 100644 (file)
--- a/gencode.c
+++ b/gencode.c
@@ -8993,12 +8993,17 @@ gen_vlan(compiler_state_t *cstate, bpf_u_int32 vlan_num, int has_vlan_tag)
 
 /*
  * support for MPLS
+ *
+ * The label_num_arg dance is to avoid annoying whining by compilers that
+ * label_num might be clobbered by longjmp - yeah, it might, but *WHO CARES*?
+ * It's not *used* after setjmp returns.
  */
 struct block *
-gen_mpls(compiler_state_t *cstate, volatile bpf_u_int32 label_num,
+gen_mpls(compiler_state_t *cstate, bpf_u_int32 label_num_arg,
     int has_label_num)
 {
        struct  block   *b0, *b1;
+       bpf_u_int32 label_num = label_num_arg;
 
        /*
         * Catch errors reported by us and routines below us, and return NULL
@@ -9759,12 +9764,18 @@ gen_mtp2type_abbrev(compiler_state_t *cstate, int type)
        return b0;
 }
 
+/*
+ * The jvalue_arg dance is to avoid annoying whining by compilers that
+ * jvalue might be clobbered by longjmp - yeah, it might, but *WHO CARES*?
+ * It's not *used* after setjmp returns.
+ */
 struct block *
 gen_mtp3field_code(compiler_state_t *cstate, int mtp3field,
-    volatile bpf_u_int32 jvalue, bpf_u_int32 jtype, int reverse)
+    bpf_u_int32 jvalue_arg, bpf_u_int32 jtype, int reverse)
 {
        struct block *b0;
        bpf_u_int32 val1 , val2 , val3;
+       bpf_u_int32 jvalue = jvalue_arg;
        u_int newoff_sio;
        u_int newoff_opc;
        u_int newoff_dpc;
index 6aea7ab0d95cd6642134e549482ee3ee944a1601..cc21e04384a6de10754dbbdb2cca102fc1603fcf 100644 (file)
--- a/gencode.h
+++ b/gencode.h
@@ -325,7 +325,7 @@ struct block *gen_llc_s_subtype(compiler_state_t *, bpf_u_int32);
 struct block *gen_llc_u_subtype(compiler_state_t *, bpf_u_int32);
 
 struct block *gen_vlan(compiler_state_t *, bpf_u_int32, int);
-struct block *gen_mpls(compiler_state_t *, volatile bpf_u_int32, int);
+struct block *gen_mpls(compiler_state_t *, bpf_u_int32, int);
 
 struct block *gen_pppoed(compiler_state_t *);
 struct block *gen_pppoes(compiler_state_t *, bpf_u_int32, int);
@@ -338,7 +338,7 @@ struct block *gen_atmtype_abbrev(compiler_state_t *, int type);
 struct block *gen_atmmulti_abbrev(compiler_state_t *, int type);
 
 struct block *gen_mtp2type_abbrev(compiler_state_t *, int type);
-struct block *gen_mtp3field_code(compiler_state_t *, int, volatile bpf_u_int32,
+struct block *gen_mtp3field_code(compiler_state_t *, int, bpf_u_int32,
     bpf_u_int32, int);
 
 struct block *gen_pf_ifname(compiler_state_t *, const char *);