--- Begin Message ---
On Aug 11, 2021, at 3:09 PM, Denis Ovsienko via tcpdump-workers 
<tcpdump-workers@lists.tcpdump.org> wrote:

> The other matter is that the gencode.h/grammar.h pair works best when
> it is included early.

Perhaps the gencode.h/grammar.h pair works best when it doesn't include 
grammar.h. :-)

I've checked in a change to remove the include of grammar.h from gencode.c; it 
builds without problems on macOS, and I suspect it will build without problems 
everywhere, as what grammar.h defines are:

        1) the names for tokens (which may be done with an enum in a fashion 
that causes large amounts of pain if another header you include helpfully - but 
uselessly, for our purposes - names for the machine's registers, and you are 
unlucky enough to be compiling for a machine that has a register named "esp", 
causing a collision with the "esp" token in pcap filter language for ESP; 
fortunately, such machines are rare :-) :-) :-) :-) :-) :-();

        2) a union of value types for all symbols in the grammar.

As far as I can tell, neither token names or values nor a value type union are 
passed to any of the gencode.c routines called from grammar.y.  We *do* pass 
values for symbols, but we select the particular union member, rather than just 
blindly passing the union as a whole.

So far, all the libpcap builds om www.tcpdump.org are green except for the 
Windows build, which is listed as pending; it's about 2/3 of the way through 
the build matrix.

--- End Message ---
_______________________________________________
tcpdump-workers mailing list
tcpdump-workers@lists.tcpdump.org
https://lists.sandelman.ca/mailman/listinfo/tcpdump-workers

Reply via email to