On Sep 5, 2007, at 2:17 PM, Saikiran Madugula wrote:
Yes, I get warning when gencode.c gets compiled with the custom
package.
(ofcourse standalone libpcap compiles fine).
gcc -O2 -I. -I<path to custom package's include files> -
DHAVE_CONFIG_H -D_U_="__attribute__((unused))" -D<XXX_ONLY> -fPIC -
DPIC -c ./gencode.c
./gencode.c:87:1: warning: "ETHERMTU" redefined
In file included from /usr/include/netinet/if_ether.h:61,
from /usr/include/netinet/ether.h:26,
from /pathtocustompackage/customheader.h
from ./pcap-int.h:55,
from ./gencode.c:65:
OK, so you have a *modified* version of gencode.c; this problem
doesn't show up with *standard* libpcap.
My apologies for loose terminology. I understand it is impossible to
predict what symbols might prop up. But to my surprise something
like ETHERMTU has been defined in that way and *I wish to only know
the reason behind this*
The reason behind this is that it's a perfectly reasonable name for
the MTU of an Ethernet, that MTU being 1500 bytes (1500 bytes of
Ethernet payload, after the 14-byte Ethernet header).
If a package supports a OS such as Linux, is it not clean way of
being cautious of symbols that OS uses ?
No, there is no clean way to be cautious of symbols the OS uses,
except not to use any symbols at all, which is a bit impractical.
-
This is the tcpdump-workers list.
Visit https://cod.sandelman.ca/ to unsubscribe.