Hello,

I noticed the following problem: I can't compile files including pcap.h
with gcc when I specify -ansi as a compiler option. The problem seems to
be the u_ types that are no longer being defined. IMHO pcap.h should make
sure it brings in any non standard types it needs itself. Until such a
time/version: Any hints how I may use -ansi and still work in a more or
less platform independent way?

 Thanks
        J�rg

System info
===========

Linux (Suse 8.0)
gcc-2.95.3-216
glibc-2.2.5-38
libpcap: 0.7.1 (not the Suse package)

Session log
===========

jmayer@madhatter:~/work/ethereal/tcpdump> cat pcap-types.c 
#include <pcap.h>

int main()
{
return 0;
}
jmayer@madhatter:~/work/ethereal/tcpdump> gcc -O pcap-types.c 
jmayer@madhatter:~/work/ethereal/tcpdump> gcc -O -ansi pcap-types.c 
In file included from /usr/local/include/pcap.h:43,
                 from pcap-types.c:1:
/usr/local/include/net/bpf.h:53: parse error before `bpf_u_int32'
/usr/local/include/net/bpf.h:53: warning: data definition has no type or storage class
/usr/local/include/net/bpf.h:74: parse error before `u_int'
/usr/local/include/net/bpf.h:74: warning: no semicolon at end of struct or union
/usr/local/include/net/bpf.h:76: parse error before `}'
/usr/local/include/net/bpf.h:82: parse error before `u_int'
/usr/local/include/net/bpf.h:82: warning: no semicolon at end of struct or union
/usr/local/include/net/bpf.h:83: warning: data definition has no type or storage class
/usr/local/include/net/bpf.h:98: parse error before `u_short'
/usr/local/include/net/bpf.h:98: warning: no semicolon at end of struct or union
/usr/local/include/net/bpf.h:99: warning: data definition has no type or storage class
/usr/local/include/net/bpf.h:151: parse error before `bpf_u_int32'
/usr/local/include/net/bpf.h:151: warning: no semicolon at end of struct or union
/usr/local/include/net/bpf.h:152: warning: data definition has no type or storage class
/usr/local/include/net/bpf.h:153: parse error before `bh_hdrlen'
/usr/local/include/net/bpf.h:153: warning: data definition has no type or storage class
/usr/local/include/net/bpf.h:404: parse error before `u_short'
/usr/local/include/net/bpf.h:404: warning: no semicolon at end of struct or union
/usr/local/include/net/bpf.h:405: warning: data definition has no type or storage class
/usr/local/include/net/bpf.h:406: parse error before `jf'
/usr/local/include/net/bpf.h:406: warning: data definition has no type or storage class
/usr/local/include/net/bpf.h:408: parse error before `}'
/usr/local/include/net/bpf.h:435: parse error before `bpf_filter'
/usr/local/include/net/bpf.h:435: parse error before `u_char'
/usr/local/include/net/bpf.h:435: warning: data definition has no type or storage class
In file included from pcap-types.c:1:
/usr/local/include/pcap.h:105: parse error before `bpf_u_int32'
/usr/local/include/pcap.h:105: warning: no semicolon at end of struct or union
/usr/local/include/pcap.h:106: warning: data definition has no type or storage class
/usr/local/include/pcap.h:107: parse error before `version_minor'
/usr/local/include/pcap.h:107: warning: data definition has no type or storage class
/usr/local/include/pcap.h:109: parse error before `sigfigs'
/usr/local/include/pcap.h:109: warning: data definition has no type or storage class
/usr/local/include/pcap.h:110: parse error before `snaplen'
/usr/local/include/pcap.h:110: warning: data definition has no type or storage class
/usr/local/include/pcap.h:111: parse error before `linktype'
/usr/local/include/pcap.h:111: warning: data definition has no type or storage class
/usr/local/include/pcap.h:121: parse error before `bpf_u_int32'
/usr/local/include/pcap.h:121: warning: no semicolon at end of struct or union
/usr/local/include/pcap.h:122: warning: data definition has no type or storage class
/usr/local/include/pcap.h:129: parse error before `u_int'
/usr/local/include/pcap.h:129: warning: no semicolon at end of struct or union
/usr/local/include/pcap.h:130: warning: data definition has no type or storage class
/usr/local/include/pcap.h:131: parse error before `ps_ifdrop'
/usr/local/include/pcap.h:131: warning: data definition has no type or storage class
/usr/local/include/pcap.h:142: parse error before `u_int'
/usr/local/include/pcap.h:142: warning: no semicolon at end of struct or union
/usr/local/include/pcap.h:158: parse error before `*'
/usr/local/include/pcap.h:162: parse error before `bpf_u_int32'
/usr/local/include/pcap.h:167: parse error before `u_char'
/usr/local/include/pcap.h:168: parse error before `u_char'
/usr/local/include/pcap.h:169: parse error before `*'
/usr/local/include/pcap.h:170: warning: data definition has no type or storage class
/usr/local/include/pcap.h:179: parse error before `bpf_u_int32'
/usr/local/include/pcap.h:181: parse error before `bpf_u_int32'
/usr/local/include/pcap.h:195: parse error before `*'
/usr/local/include/pcap.h:201: parse error before `bpf_filter'
/usr/local/include/pcap.h:201: parse error before `u_char'
/usr/local/include/pcap.h:201: warning: data definition has no type or storage class
jmayer@madhatter:~/work/ethereal/tcpdump> 
--
Joerg Mayer                                          <[EMAIL PROTECTED]>
I found out that "pro" means "instead of" (as in proconsul). Now I know
what proactive means.

-
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