> On HP-UX 10.20 with Gcc-2.95.2:
> 
> make
> gcc -O2 -O -I/users2/local/include -I.  -DHAVE_CONFIG_H -c ./pcap.c

Why is there a "-I/users2/local/include" before the "-I."?

If you remove it, it will probably compile, as:

> ./pcap.c: In function pcap_close':
> ./pcap.c:224: warning: passing arg 1 of pcap_freecode' from incompatible pointer type
> ./pcap.c:224: too few arguments to function pcap_freecode'

        1) "pcap_freecode()" is declared, by the "pcap.h" that comes
           with 0.6.1,  to take only a "struct bpf_program *" as an
           argument;

        2) the "pcap-int.h" that comes with 0.6.1 declares the "fcode"
           member of a "struct pcap" to be a "struct bpf_program", and
           the "pcap.h" that comes with 0.6.1 typedefs a "pcap_t" to be
           a "struct pcap";

        3) the line of code in question in "pcap.c"is

                pcap_freecode(&p->fcode);

           where "p" is a "pcap_t";

so the code does, in fact, call "pcap_freecode()" correctly - which is
why it built without problems on several platforms.

However, if, in fact, it's including *NOT* the "pcap.h" that comes with
0.6.1, but is, instead, including an earlier version of "pcap.h", which
declared a nonexistent "pcap_freecode()" routine and declared it
differently from the way it was finally implemented in 0.6, the compile
would fail; we cannot make any guarantee that libpcap will compile
correctly if compiled with a "pcap.h" other than the one it came with.
-
This is the TCPDUMP workers list. It is archived at
http://www.tcpdump.org/lists/workers/index.html
To unsubscribe use mailto:[EMAIL PROTECTED]?body=unsubscribe

Reply via email to