From: Guy Harris Date: Fri, 26 Oct 2018 20:02:59 +0000 (-0700) Subject: Make qerr const. X-Git-Tag: libpcap-1.10-bp~749 X-Git-Url: https://git.tcpdump.org/libpcap/commitdiff_plain/cd512217e570f796ef3e3a7ad67c66d78c83c2dc Make qerr const. It's not something we're allowed to modify, as that could fail if two or more threads are all running in pcap_compile(); declare it as const to make sure we don't modify it. --- diff --git a/grammar.y b/grammar.y index e060cdea..3eeb135c 100644 --- a/grammar.y +++ b/grammar.y @@ -237,7 +237,7 @@ str2tok(const char *str, const struct tok *toks) return (-1); } -static struct qual qerr = { Q_UNDEF, Q_UNDEF, Q_UNDEF, Q_UNDEF }; +static const struct qual qerr = { Q_UNDEF, Q_UNDEF, Q_UNDEF, Q_UNDEF }; static PCAP_NORETURN_DEF void yyerror(void *yyscanner _U_, compiler_state_t *cstate, const char *msg)