[Winpcap-users] [PATCH] mingw build

Gianluca Varenni gianluca.varenni at cacetech.com
Tue Oct 12 09:43:55 PDT 2010

From: "Guy Harris" <guy at alum.mit.edu>
Sent: Wednesday, October 06, 2010 5:02 PM
To: <winpcap-users at winpcap.org>
Subject: Re: [Winpcap-users] [PATCH] mingw build

> On Sep 14, 2010, at 9:17 AM, Alon Bar-Lev wrote:
>> 4. grammar.y - any idea why we need pcap_parse if yacc defines it
>> anyway instead of yyparse?
> Because
> 1) WinPcap is based on libpcap;
> 2) libpcap was originally written back when many UN*Xes had only the old 
> AT&T YACC, which only defined yyparse().
> The current top-of-trunk version of grammar.y, at least, defines 
> pcap_parse() only if YYBISON is not defined, which presumably means "not 
> Bison".
>> 5. yacc does not accept -y argument.
> Earlier versions of GNUmakefile mirrored the UN*X Makefile.in, and had a 
> YACC variable that ran Bison, rather than YACC, with the "-y" flag (which, 
> for Bison, means "act like YACC and produce y.tab.c and y.tab.h files").
> The 4.1.2 version runs whatever make sets YACC to refer to, with the 
> YFLAGS flag.  Is there some reason why that was done?

No idea. The original GNUMakefile was contributed by someone and included 
into the WinPcap sources.
I modified GNUMakefile to
1. define "BISON = bison" and "FLEX = flex"
2. use ${BISON} to compile grammar.y

> Was this to support parser-generators *other* than Bison?  Unless there's 
> a compelling reason not to run Bison, it should probably go back to the 
> way it was, using Bison - that'll fix that problem *and* the previous 
> problem, with no changes required to grammar.y.
> If there *is* a compelling reason not to run Bison, then
> 1) it should not include "-y"
> and
> 2) either it should not do "-p pcap_", if whatever version of YACC is 
> being used doesn't support "-p", or:
> 2a) grammar.y should check for YYBISON *and* some other #define named 
> appropriately for whatever parser-generator is being used
> and
> 2b) it should do "-D{that #define name}".
>> 7. Minor modification of (char*)A += code.
> (I.e., "casting lvalues considered harmful - and possibly rejected by some 
> compilers.")

I will commit it on the libpcap git repository as soon as possible.

Have a nice day

> _______________________________________________
> Winpcap-users mailing list
> Winpcap-users at winpcap.org
> https://www.winpcap.org/mailman/listinfo/winpcap-users 

More information about the Winpcap-users mailing list