[prev in list] [next in list] [prev in thread] [next in thread] 

List:       tcpdump-patches
Subject:    Problems compiling under HP-UX B.10.20
From:       Mike Jetzer <mjetzer () mke ! catalystwms ! com>
Date:       2000-09-13 15:48:32
[Download RAW message or body]

I compiled libpcap-0.5.2 and tcpdump-3.5.2 under HP-UX B.10.20, using HP's
ANSI
compiler, and have the following to report:


For libpcap, the HP version of make can't find bpf_filter.c, which is in the
bpf/net directory.  I used a GNU version of "make", which found it just
fine.
(The problem appears to be in the CSRC macro definition; changing it to be
bpf/net/bpf_filter.c seems to work well enough, but then the definition of
OBJ
gets messed up, because the ".o" file is in the current directory, rather
than
"bpf/net".)  Maybe just add a note stating that the HP version of "make"
doesn't work.

Similarly, the HP version of "lex" fails.  Of course, the Makefile suggests
using flex, but the README might be updated to state that the HP version of
lex simply won't work.

gencode.c produces an "Uninitialized variable "b0" in function
"gen_proto_abbrev" warning.  While I didn't extensively research this, it
would appear that with the #defines which are defined for HP-UX, b0 is never
assigned.  Initializing b0 and b1 to NULL solves this warning.


For tcpdump, the configure script has a line about "checking for HP-UX ansi
compiler (cc -Aa -D_HPUX_SOURCE)", but "-D_HPUX_SOURCE" is never added to
the
generated Makefile.  Failure to use this will result in compilation
failures.

"interface.h" had a couple of warnings generated for most or all of the
objects:
    line 142: warning 617: Redeclaration of tag "timeval" ignored
    line 173: warning 617: Redeclaration of tag "pcap_pkthdr" ignored

"struct timeval" is declared in <sys/time.h>, which many files #include, so
this would seem to be the source of the conflict.  Unfortunately, there are
some files don't #include <sys/time.h>, before they #include "interface.h".
I
removed the declaration of "struct timeval" from "interface.h"; this wound
up
generating two warnings, but having it in generated 53, so this seems to be
an
improvement :-).

"struct pcap_pkthdr" is declared in libpcap's pcap.h, which is #included by
many files, so this would appear to be the source of the conflict.  Putting
a "#define STRUCT_PCAP_PKTHDR 1" in pcap.h and then protecting the "struct
pcap_pkthdr" with
    #if defined(__STDC__) && !defined(STRUCT_PCAP_PKTHDR)
in interface.h seemed to work fine.


print-vjc.c winds up being considered "empty" by the compiler, since
__bsdi__
is not defined.  I just added an #else before the final #endif and added a
"static int dummy = 0" to avoid the warning.


print-bpg.c has several warnings due to the fact that getname() is declared
to
take an unsigned character pointer, but simple character pointers are passed
to
it (in some cases, the argument is explicitly cast to "char *").


print-rx.c has fs_print() prototyped as static, but the actual definition is
not static; this generated a compiler warning which can be fixed by making
the function's definition static as well.

print-rx.c also had a long list of warnings regarding pointer
incompatibility,
due to the fact that bos_print()'s argument has "bp" being an unsigned
character pointer, but POSIX defines strncpy() to take a simple character
pointer (not an unsigned character pointer).


print-lane.c generates warnings because the packetp and snapend character
pointers are declared static in print-lane.c, but are defined as "extern"
in interface.h.  The compiler decides to make them static and things seem to
work, but this should probably be fixed.


print-smb.c generates a long list of warnings regarding pointer
incompatibility.  Some of these are from print_trans2() assigning f1 and f2
(which are unsigned char *) values from the smbdescript structure, which are
simple char * values.  Also in print_trans2(), f1 and f2 passed to fdata(),
which is not expecting an unsigned char *.

In print_trans(), f1, f2, f3, and f4 are unsigned char *, but are assigned
string constants (which are not unsigned).  f1 - f4 are also passed to
fdata().
data1 (unsigned char *) is also passed to strcmp(), which does not expected
signed pointers.

print_negprot() and print_sesssetup() also has f1 and f2 defined as unsigned
char *, but assigned string constants and passed to fdata().

nbt_udp137_print() assigns p (const char *) the value of data (const
unsigned
char *), and sends p as the first argument of fdata() (where fdata is
expecting
and unsigned value as the first and third argument).  p is also passed to
print_data(), which is also expecting an unsigned argument.


smbutil.c also has a number of pointer incompatibility warnings.

name_len() assigns s0, a signed character pointer, to s, an unsigned
character
pointer.

fdata1() sends unistr() buf (unsigned), but unistr() is expecting a signed
argument.  It also sends name_extract() startbuf (unsigned), while it
expects
a signed argument.  It also sends interpret_long_date() an unsigned value.


In print-telnet.c, telnet_print() sends strcpy() rcp (unsigned), while POSIX
defines strcpy() as taking signed arguments.

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic