summaryrefslogtreecommitdiff
path: root/gencode.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2018-11-10 14:30:31 -0800
committerGuy Harris <guy@alum.mit.edu>2018-11-10 14:30:31 -0800
commit26a58dd3ce0bd8de1be2f31a1f715c776834d7b0 (patch)
tree6ab0b602c58fde2f84c6c5d174480f19e807f04e /gencode.c
parent8ea43c7efd75567783f7f53afe151b6f8971df93 (diff)
downloadlibpcap-26a58dd3ce0bd8de1be2f31a1f715c776834d7b0.tar.gz
See if *this* squelches the "clobbered by longjmp" warnings.
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.
Diffstat (limited to 'gencode.c')
-rw-r--r--gencode.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/gencode.c b/gencode.c
index ab862641..6ff3de82 100644
--- 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;